Skip to content

Commit

Permalink
chore(#8159): Run our e2e standard test on minimum browser requiremen…
Browse files Browse the repository at this point in the history
…ts (#8663)

* Fix standard config specs to run on chrome 90

* Add changes after npm install

* Revert unwanted changes

* Add suggested feedback

* Fix chrome_version env variable setup

* Add chrome version to test name

* Update binary not to use my local chrome

* install chromedriver 90

* Revert deletion of chromedriver 90 dependency

* Delete chromedriver dependency

* Fix spaces in run

* Change where to set CHROME_VERSION env

* Add no-sandbox to prevent session not created chromedriver error

* Revert change in the test names

* Merge Install Chrome and Chromedriver version 90 in one step

Co-authored-by: Gareth Bowen <gareth@medic.org>

* Change name in step and, simplify chrome args

* Fix name calculation

* Fix eslint

* Fix >> character

* Add await browser.url('/'); before login

* Add await browser.url('/'); before logout

* Change roleField selector to work also on Chrome90

* Fix eslint

* Use browserVersion to choose the method to get text from a span element

* Fix eslint

* Delete browser.url('/'); after logout

* Delete no-sandbox option

* Delete unnecessary waits

* expose a common function to validate if the browser version is the minimum

* Fix eslint

* Create standard enketo wdio page to have common enketo forms definitions

* Fix eslint

* Delete BrowserVersion as is not neccesary if setting binary

* Set undefined browserVersion when is not minimum

* Delete chromedriver dependencies

* Add chromedriver binary path

* Add disable-dev-shm-usage arg

* Fix eslint

* Fix misspelled

* Check chromedriver version

* Get chromedriver version

* Use node modules chromedriver

* Fix driver version output

* Add no-sandbox to make the test pass, and print browser and driver versions

* Fix eslint

* Add no-sandbox argument only when running tests with chrome90

* Implement feedback

---------

Co-authored-by: Maria Lorena Rodriguez Viruel <marialorenarodriguezviruel@MacBook-Pro-de-Maria.local>
Co-authored-by: Gareth Bowen <gareth@medic.org>
  • Loading branch information
3 people authored Nov 8, 2023
1 parent c34e12b commit 1d9e77b
Show file tree
Hide file tree
Showing 15 changed files with 334 additions and 43 deletions.
24 changes: 19 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,17 @@ jobs:

tests:
needs: build
name: ${{ matrix.cmd }}-${{ matrix.suite || '' }}
name: ${{ matrix.cmd }}-${{ matrix.suite || '' }}${{ matrix.chrome-version == '90' && '-minimum-browser' || '' }}
runs-on: ubuntu-22.04
env:
NODE: 16.x
CHROME_VERSION: ${{ matrix.chrome-version }}

strategy:
fail-fast: false
matrix:
cmd: ['ci-webdriver-standard', 'ci-e2e-integration', 'ci-webdriver-default-mobile']
chrome-version: ['90', 'latest']
suite: [all]
include:
- cmd: ci-webdriver-default
Expand All @@ -109,7 +111,13 @@ jobs:
suite: lowLevel
- cmd: ci-webdriver-default
suite: workflows

exclude: # temporary until all suites run on Chrome 90
- cmd: ci-e2e-integration
chrome-version: 90
- cmd: ci-webdriver-default-mobile
chrome-version: 90
- cmd: ci-webdriver-default
chrome-version: 90
steps:
- name: Login to Docker Hub
uses: docker/login-action@v2
Expand Down Expand Up @@ -150,7 +158,7 @@ jobs:
if: ${{ !env.INTERNAL_CONTRIBUTOR }}

- name: Set ENV
run: |
run: |
echo "HORTI_BUILDS_SERVER=$MARKET_URL_READ/$BUILDS_SERVER" >> $GITHUB_ENV
- name: Create logs directory
run: mkdir tests/logs
Expand All @@ -169,9 +177,15 @@ jobs:
run: |
mkdir -p allure-results/history
cp -r build-history-data/cht-core/allure/${{ matrix.cmd }}-${{ matrix.suite }}/allure-report/history allure-results | true
- name: Run tests ${{ matrix.cmd }}-${{ matrix.suite }}
- name: Install Chrome 90
if: ${{matrix.chrome-version=='90'}}
run: |
wget -O "google-chrome-stable_current_amd64.deb" https://www.slimjet.com/chrome/download-chrome.php?file=files/90.0.4430.72/google-chrome-stable_current_amd64.deb
sudo dpkg -i "google-chrome-stable_current_amd64.deb"
npm install chromedriver@^90.0.1
- name: Run tests ${{ matrix.cmd }}-${{ matrix.suite }} on Chrome ${{ matrix.chrome-version }}
run: npm run ${{ matrix.cmd }} -- --suite=${{ matrix.suite }}

- name: Fetch allure history
if: always()
uses: actions/checkout@v3
Expand Down
211 changes: 208 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@
"typescript": "^5.1.6",
"uglify-js": "^3.17.4",
"uuid": "^9.0.1",
"wdio-chromedriver-service": "^8.1.1",
"webpack-bundle-analyzer": "^4.9.1",
"zone.js": "^0.13.3"
},
Expand Down
Loading

0 comments on commit 1d9e77b

Please sign in to comment.