Skip to content

Commit

Permalink
Merge pull request #723 from CSSSR/migrate-e2e-to-github
Browse files Browse the repository at this point in the history
chore(e2e): migrate e2e tests launch to github actions
  • Loading branch information
verdel authored Mar 11, 2022
2 parents 6ae83a3 + 68763da commit cd56531
Show file tree
Hide file tree
Showing 5 changed files with 1,606 additions and 485 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/run-nightwatch-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Этот файл сгенерирован автоматически, не редактируйте его вручную

name: Run Nightwatch e2e tests
concurrency: e2e-tests
on:
workflow_dispatch:
inputs:
launchUrl:
description: Базовый URL сайта
default: 'https://blog.csssr.com/'
required: true
browserName:
description: Название браузера как в e2e-tools.json
default: remote_chrome
required: true
checkScreenshots:
description: Проверка скриншотов
default: 'true'
required: true
permissions:
actions: read
checks: none
contents: read
deployments: none
issues: none
packages: none
pull-requests: none
repository-projects: none
security-events: none
statuses: none
jobs:
run-tests:
name: Run tests
runs-on:
- self-hosted
- e2e-tests
timeout-minutes: 90
steps:
- uses: actions/checkout@v2
with:
lfs: true
- run: yarn install --frozen-lockfile
working-directory: e2e-tests
- run: 'yarn et nightwatch:run --browser ${{ github.event.inputs.browserName }} --checkScreenshots=${{ github.event.inputs.checkScreenshots }}'
working-directory: e2e-tests
env:
REMOTE_CHROME_SELENIUM_USERNAME: '${{ secrets.SELENIUM_USERNAME }}'
REMOTE_CHROME_SELENIUM_PASSWORD: '${{ secrets.SELENIUM_PASSWORD }}'
REMOTE_FIREFOX_SELENIUM_USERNAME: '${{ secrets.SELENIUM_USERNAME }}'
REMOTE_FIREFOX_SELENIUM_PASSWORD: '${{ secrets.SELENIUM_PASSWORD }}'
REMOTE_SAFARI_SELENIUM_USERNAME: '${{ secrets.SELENIUM_USERNAME }}'
REMOTE_SAFARI_SELENIUM_PASSWORD: '${{ secrets.SELENIUM_PASSWORD }}'
LAUNCH_URL: '${{ github.event.inputs.launchUrl }}'
ENABLE_ALLURE_REPORT: 'true'
- if: always()
name: Generate Allure report
run: node -e 'require("@csssr/e2e-tools/upload-allure-report")'
working-directory: e2e-tests
id: allure
env:
LAUNCH_URL: '${{ github.event.inputs.launchUrl }}'
RUN_COMMAND: 'yarn et nightwatch:run --browser ${{ github.event.inputs.browserName }} --checkScreenshots=${{ github.event.inputs.checkScreenshots }}'
ALLURE_REPORT_DIRECTORIES: 'codecept/report/allure-reports/,nightwatch/report/allure-reports/'
AWS_ACCESS_KEY_ID: '${{ secrets.TEST_REPORTS_AWS_ACCESS_KEY_ID }}'
AWS_SECRET_ACCESS_KEY: '${{ secrets.TEST_REPORTS_AWS_SECRET_ACCESS_KEY }}'
3 changes: 2 additions & 1 deletion .github/workflows/update-e2e-tools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12.x'
node-version: 14
cache: yarn

- name: Upgrade e2e tests dependencies
working-directory: e2e-tests
Expand Down
24 changes: 11 additions & 13 deletions e2e-tests/e2e-tools.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"tools": {
"@csssr/e2e-tools-nightwatch": {
"githubActions": { "enabled": true },
"browsers": {
"local_chrome": {
"default": true,
Expand All @@ -15,10 +16,9 @@
"remote": true,
"type": "selenium",
"url": "https://chrome.selenium.csssr.cloud/",
"basicAuth": {
"credentialsId": "chromedriver",
"username_env": "CHROMEDRIVER_USERNAME",
"password_env": "CHROMEDRIVER_PASSWORD"
"seleniumBasicAuth": {
"username_env": "SELENIUM_USERNAME",
"password_env": "SELENIUM_PASSWORD"
},
"desiredCapabilities": {
"browserName": "chrome",
Expand All @@ -38,10 +38,9 @@
"remote": true,
"type": "selenium",
"url": "https://firefox.selenium.csssr.cloud",
"basicAuth": {
"credentialsId": "chromedriver",
"username_env": "CHROMEDRIVER_USERNAME",
"password_env": "CHROMEDRIVER_PASSWORD"
"seleniumBasicAuth": {
"username_env": "SELENIUM_USERNAME",
"password_env": "SELENIUM_PASSWORD"
},
"desiredCapabilities": {
"browserName": "firefox",
Expand All @@ -52,11 +51,10 @@
"remote_safari": {
"remote": true,
"type": "selenium",
"url": "https://safari1.selenium.csssr.cloud",
"basicAuth": {
"credentialsId": "chromedriver",
"username_env": "CHROMEDRIVER_USERNAME",
"password_env": "CHROMEDRIVER_PASSWORD"
"url": "https://safari.selenium.csssr.cloud",
"seleniumBasicAuth": {
"username_env": "SELENIUM_USERNAME",
"password_env": "SELENIUM_PASSWORD"
},
"desiredCapabilities": { "browserName": "safari" },
"globals": { "skipScreenshotAssertions": false }
Expand Down
4 changes: 2 additions & 2 deletions e2e-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"private": true,
"prettier": "@csssr/e2e-tools/prettier",
"devDependencies": {
"@csssr/e2e-tools": "~1.4.2",
"@csssr/e2e-tools-nightwatch": "~1.15.5"
"@csssr/e2e-tools": "~1.6.6",
"@csssr/e2e-tools-nightwatch": "~1.15.14"
},
"resolutions": {
"netmask": ">=2.0.1"
Expand Down
Loading

0 comments on commit cd56531

Please sign in to comment.