MIT License

项目介绍

wlsf82/gitlab-cypress 是一个托管在 GitHub 上的开源项目,主要使用 JavaScript 编写,采用 MIT License 许可证,目前获得 105 个 Star、30 次 Fork。

仓库全名
wlsf82/gitlab-cypress
开源许可证
MIT License
Star 数
105
Fork 数
30
未关闭 Issue
9

README 摘要

GitLab Cypress Sample project to experiment with Cypress to test the GitLab application. Pre-requirements You need a GitLab local environment running using this Docker image. You also need to have Node.js and npm installed on your computer. For this project, the following versions of Node.js and npm were used: Running GitLab on Docker Run docker run --publish 80:80 --name gitlab --hostname localhost wlsf82/gitlab-ce…

完整内容见 GitHub 原始 README 或本页 。

常见问题

gitlab-cypress 用什么语言开发?

主要使用 JavaScript 编写,采用 MIT License 许可证,目前有 105 个 Star。

gitlab-cypress 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 gitlab-cypress 的源码?

可以直接克隆仓库:git clone https://github.com/wlsf82/gitlab-cypress.git,默认分支为 main;安装与运行步骤见仓库 README。

gitlab-cypress 最近还在维护吗?

仓库最近一次更新为 9月3日,当前有 9 个未关闭 Issue;Star 数为 105,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

Sample project to experiment with Cypress to test the GitLab application.

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
170
价值分
72
活跃状态
活跃

语言占比

JavaScript

README

GitLab Cypress

main gitlab-cypess

Sample project to experiment with Cypress to test the GitLab application.

Pre-requirements

You need a GitLab local environment running using this Docker image.

You also need to have Node.js and npm installed on your computer.

For this project, the following versions of Node.js and npm were used:

$ node -v
v24.16.0

$ npm -v
11.13.0

Running GitLab on Docker

Run docker run --publish 80:80 --name gitlab --hostname localhost wlsf82/gitlab-ce and wait for the environment to be up and running (this might take a minute or so).

Everything should be OK if, when you access http://localhost/, a form appears to set the root user password.

❗THERE’S NO NEED TO DEFINE THE PASSWORD MANUALLY❗

There’s an automated test for it. 😉

Keep reading.

Installation

Run npm i to install the dev dependencies.

Tests

Before running the tests, create a file called cypress.env.json in the project root directory, based on the cypress.env.example.json file, and update the value of the USERPASSWORD property with one of your choice.

By default, the tests will run against http://localhost/, but if you need to run them at a different URL (e.g., http://localhost:3000/), change the baseUrl property in the cypress.config.js file.

Headless mode

Run npm test to run all tests in headless mode.

Run npm run test:api to run only the API tests in headless mode.

Run npm run test:gui:project:issue to run only the GUI Project-issue-related tests in headless mode.

Run npm run test:gui:project:but:issue to run only the GUI Project-but-issue-related tests in headless mode.

Run npm run test:gui:all:but:project to run only the GUI Project-not-related tests in headless mode.

Interactive mode

  1. Run npm run cy:open to open the Cypress App;
  2. Select E2E Testing;
  3. Select one of the available browsers (e.g., Electron), and click the Start button;
  4. Run the cypress/e2e/gui/profile/createAccessToken.cy.js test;
  5. Finally, click on the test file you want to run and wait for it to finish.

Important notes about the above steps

Do not skip step 4! It will authenticate the root user, create a GitLab Access Token, and make it available to all other tests while the Cypress App is kept open unless the cypress/e2e/gui/profile/deleteAccessTokens.cy.js test is run. In such a case, the cypress/e2e/gui/profile/createAccessToken.cy.js test needs to be re-run.

Also, step 4 creates a session for the root user, which most tests will restore. This means login via the GUI should happen only once, speeding up execution. 🏎️

Example

Here’s an example of running all the GUI tests in interactive mode.

https://user-images.githubusercontent.com/2768415/225186210-4dd51c26-9baf-4e65-9b09-6f79a818a7d5.mp4

Contributing

If you want to contribute to this project, follow the steps below.

  1. Fork the project;
  2. Clone your fork and make your changes;
  3. Test your changes locally, and move on only when all tests are green;
  4. Push your changes to GitHub and create a pull request (PR);
  5. After the GitHub Workflow of your PR is green, tag @wlsf82, ask for review, and wait for feedback;
  6. If everything goes well, you should have your changes rebased and merged into the main branch. Otherwise, you will receive comments with adjustments needed before merging.

This is the commit messaging guidelines you should follow.


Developed with 💚 by Walmyr.

评论

暂无评论