Skip to content

Commit

Permalink
feat: replace cypress with playwright
Browse files Browse the repository at this point in the history
  • Loading branch information
3cp committed Jun 20, 2022
1 parent ca77edf commit 7f146b1
Show file tree
Hide file tree
Showing 31 changed files with 237 additions and 286 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node_version: [14, 16]
node_version: [14, 16, 18]
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
fail-fast: false
matrix:
node_version:
- 16
- 18
os:
- ubuntu-latest
target_features:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-macOS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
node_version:
- 16
- 18
os:
- macOS-latest
target_features:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
node_version:
- 16
- 18
os:
- windows-latest
target_features:
Expand Down
4 changes: 4 additions & 0 deletions __test__/after-task.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ test('"after" task only prints summary in unattended mode', async t => {
prompts,
run,
properties: {name: 'my-app'},
features: ['a', 'b'],
notDefaultFeatures: ['a', 'b-c'],
ansiColors
}, {
Expand Down Expand Up @@ -61,6 +62,7 @@ test('"after" task only prints summary in unattended mode and here mode', async
prompts,
run,
properties: {name: 'my-app'},
features: ['a', 'b'],
notDefaultFeatures: ['a', 'b-c'],
ansiColors
}, {
Expand Down Expand Up @@ -97,6 +99,7 @@ test('"after" task installs deps, and prints summary', async t => {
prompts,
run,
properties: {name: 'my-app'},
features: ['a', 'b'],
notDefaultFeatures: ['a', 'b-c'],
ansiColors
}, {
Expand Down Expand Up @@ -135,6 +138,7 @@ test('"after" task installs deps, and prints summary in here mode', async t => {
prompts,
run,
properties: {name: 'my-app'},
features: ['a', 'b'],
notDefaultFeatures: ['a', 'b-c'],
ansiColors
}, {
Expand Down
10 changes: 8 additions & 2 deletions after.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function isAvailable(bin) {
}

module.exports = async function({
unattended, here, prompts, run, properties, notDefaultFeatures, ansiColors
unattended, here, prompts, run, properties, features, notDefaultFeatures, ansiColors
}, {
// for testing
_isAvailable = isAvailable,
Expand Down Expand Up @@ -42,6 +42,9 @@ module.exports = async function({

if (result) {
await run(result, ['install']);
if (features.includes('playwright')) {
await run('npx', ['playwright', 'install', '--with-deps']);
}
depsInstalled = true;
}

Expand All @@ -51,6 +54,9 @@ module.exports = async function({

_log(`\n${c.underline.bold('Get Started')}`);
if (!here) _log('cd ' + properties.name);
if (!depsInstalled) _log('npm install');
if (!depsInstalled) {
_log('npm install');
if (features.includes('playwright')) _log('npx playwright install --with-deps');
}
_log('npm start\n');
};
6 changes: 3 additions & 3 deletions common/.gitignore__append-if-exists
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ node_modules
// @if karma
/test/coverage-karma
// @endif
// @if cypress
/cypress/videos
/cypress/screenshots
// @if playwright
/test-results
/playwright-report
// @endif
8 changes: 0 additions & 8 deletions common/tsconfig.json__if_typescript
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,6 @@
"module": "esnext",
// @endif

// @if cypress && karma
"types": ["jasmine"],
// @endif

// @if cypress && jest && cli-bundler
"types": ["node", "jest"],
// @endif

"typeRoots": ["./node_modules/@types"],

"removeComments": true,
Expand Down
18 changes: 0 additions & 18 deletions cypress/README.md

This file was deleted.

44 changes: 0 additions & 44 deletions cypress/aurelia_project/tasks/cypress.ext

This file was deleted.

26 changes: 0 additions & 26 deletions cypress/aurelia_project/tasks/cypress.json

This file was deleted.

11 changes: 0 additions & 11 deletions cypress/cypress.config.js

This file was deleted.

1 change: 0 additions & 1 deletion cypress/cypress.json

This file was deleted.

5 changes: 0 additions & 5 deletions cypress/cypress/.eslintrc.json

This file was deleted.

5 changes: 0 additions & 5 deletions cypress/cypress/fixtures/example.json

This file was deleted.

20 changes: 0 additions & 20 deletions cypress/cypress/plugins/index.js

This file was deleted.

25 changes: 0 additions & 25 deletions cypress/cypress/support/commands.js

This file was deleted.

20 changes: 0 additions & 20 deletions cypress/cypress/support/index.js

This file was deleted.

14 changes: 0 additions & 14 deletions cypress/cypress/tsconfig.json__if_typescript

This file was deleted.

10 changes: 0 additions & 10 deletions cypress/package.json

This file was deleted.

10 changes: 5 additions & 5 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# build stage
FROM node:lts as build-stage

// @if cypress || karma
// @if playwright || karma
ENV DEBIAN_FRONTEND=noninteractive

#update apt-get
Expand Down Expand Up @@ -67,8 +67,8 @@ COPY src ./src
COPY test ./test
// @endif

// @if cypress
COPY cypress ./cypress
// @if playwright
COPY e2e ./e2e
// @endif

// @if cli-bundler && dotnet-core
Expand All @@ -80,9 +80,9 @@ COPY wwwroot ./wwwroot
RUN au test
// @endif

// @if cypress
// @if e2e
# RUN E2E TESTS
RUN npm run e2e:headless
RUN npm run e2e
// @endif

# build
Expand Down
Loading

0 comments on commit 7f146b1

Please sign in to comment.