Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Commit

Permalink
Add Typescript and page objects to E2E suite (#6582)
Browse files Browse the repository at this point in the history
* Initial playwright

* Updated e2e to use playwright and typescript

* Update set up environment and jest package

* Add changelog

* Add await to uncheck

* Fix formatting

* Revert jset back to ~24, as >25 runs slower, see jestjs/jest#9457

* Removed some unnecessary uses of waitForSelector

* Fix eslint issue

* Fix the e2e tests with latest updates

* Running most tests, with typescript now

* Fix any outstanding queries for the tests to work

* Update changelog

* Remove unnecessary jest version and unnecessary transform setting

* Fix test case broken after rebase

* Add fix to make e2e tests more robust

* Making sure dropdown value is correct

* Reove the wcpay condition for features number
  • Loading branch information
louwie17 authored Mar 17, 2021
1 parent 67d13ee commit 8077868
Show file tree
Hide file tree
Showing 44 changed files with 4,235 additions and 2,668 deletions.
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ module.exports = {
'jest/valid-title': 'warn',
'@wordpress/no-global-active-element': 'warn',
},
settings: {
jest: {
// only needed as we use jest-24.9.0 in our package.json, can be removed once we update and set it to 'jest'.
version: '24.9.0',
},
},
overrides: [
{
files: [ '*.ts', '*.tsx' ],
Expand Down
1 change: 1 addition & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ module.exports = function ( api ) {
...e2eBabelConfig,
presets: [
...e2eBabelConfig.presets,
'@babel/preset-typescript',
'@wordpress/babel-preset-default',
],
sourceType: 'unambiguous',
Expand Down
30 changes: 30 additions & 0 deletions bin/wait-for-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash
# Max amount of time to wait for the Docker container to be built
# Allowing 30 polling attempts, 10 seconds delay between each attempt
MAX_ATTEMPTS=30

# Delay (in seconds) between each polling attempt
DELAY_SEC=10

# Counter for the loop that checks if the Docker container had been built
count=0
WP_BASE_URL=$(node node_modules/@woocommerce/e2e-environment/utils/get-base-url.js)
printf "Testing URL: $WP_BASE_URL\n\n"

while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' ${WP_BASE_URL}/?pagename=ready)" != "200" ]]

do
echo "$(date) - Docker container is still being built"
sleep ${DELAY_SEC}

((count++))

if [[ $count -gt ${MAX_ATTEMPTS} ]]; then
echo "$(date) - Docker container couldn't be built"
exit 1
fi
done

if [[ $count -gt 0 ]]; then
echo "$(date) - Docker container had been built successfully"
fi
Loading

0 comments on commit 8077868

Please sign in to comment.