-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ecfeeb7
commit f9f7f29
Showing
28 changed files
with
1,314 additions
and
529 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,5 @@ on: | |
jobs: | ||
build: | ||
uses: './.github/workflows/build.yml' | ||
e2e-tests: | ||
uses: './.github/workflows/e2e-tests.yml' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: build | ||
jobs: | ||
e2e-tests: | ||
name: Test (${{ matrix.shard }}/${{ strategy.job-total}}) | ||
strategy: | ||
matrix: | ||
shard: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] | ||
os: [ubuntu-latest] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18.x' | ||
cache: 'npm' | ||
registry-url: 'https://registry.npmjs.org' | ||
- run: npm ci | ||
- run: npx playwright install --with-deps | ||
- run: npm run build:coverage | ||
- run: npm run e2e -- --shard=${{ matrix.shard }}/${{ strategy.job-total}} | ||
- uses: codecov/codecov-action@v3 | ||
with: | ||
file: e2e/coverage/lcov.info | ||
flags: e2e-${{ matrix.shard }}/${{ strategy.job-total}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ playwright-report/ | |
test-results/ | ||
.svelte-kit/ | ||
dist.tar.gz | ||
.nyc_output/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ node_modules | |
dist | ||
.angular | ||
coverage/ | ||
.nyc_output/ | ||
playwright-report/ | ||
test-results/ | ||
.svelte-kit/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module.exports = { | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.(js|ts)$/, | ||
loader: 'coverage-istanbul-loader', | ||
options: {esModules: true}, | ||
enforce: 'post', | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
include: [require('path').join(__dirname, '..', 'lib', 'src'), require('path').join(__dirname, '..', '..', 'core')], | ||
exclude: [/\.(e2e|spec|po)\.ts$/, /node_modules/, /(ngfactory|ngstyle)\.js/], | ||
}, | ||
], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import type {Page} from '@playwright/test'; | ||
import {test as base} from '@playwright/test'; | ||
import {promises as fs} from 'fs'; | ||
import path from 'path'; | ||
import {v4 as uuidv4} from 'uuid'; | ||
|
||
async function afterEach({page}: {page: Page}) { | ||
const coverage: string = await page.evaluate(() => { | ||
return JSON.stringify((window as any).__coverage__); | ||
}); | ||
if (coverage) { | ||
await fs.writeFile(path.join(__dirname, '.nyc_output', `${uuidv4()}.json`), coverage); | ||
} | ||
} | ||
export {expect} from '@playwright/test'; | ||
export function getTest() { | ||
const test = base.extend({}); | ||
test.afterEach(afterEach); | ||
return test; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import NYC from 'nyc'; | ||
import {promises as fs} from 'fs'; | ||
import {rm} from 'fs/promises'; | ||
import path from 'path'; | ||
|
||
async function globalSetup() { | ||
console.log('Cleaning up coverage folders...'); | ||
const nycDir = path.join('e2e', '.nyc_output'); | ||
const reportDir = path.join('e2e', 'coverage'); | ||
await rm(nycDir, {recursive: true, force: true}); | ||
await fs.mkdir(nycDir); | ||
await rm(reportDir, {recursive: true, force: true}); | ||
await fs.mkdir(reportDir); | ||
console.log('Coverage setup ready !'); | ||
const nycInstance = new NYC({ | ||
cwd: __dirname, | ||
['report-dir']: reportDir, | ||
reporter: ['lcov', 'json', 'text-summary'], | ||
extension: ['.ts', '.tsx', '.svelte'], | ||
}); | ||
return async () => { | ||
console.log('Saving coverage report...'); | ||
await nycInstance.report(); | ||
console.log('Coverage report saved !'); | ||
}; | ||
} | ||
|
||
export default globalSetup; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.