-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #250 from codeceptjs/kobenguyent-patch-1
- Loading branch information
Showing
8 changed files
with
119 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# This to verify lib version bump doesn't break anything | ||
name: E2E Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
pull_request: | ||
branches: | ||
- '**' | ||
|
||
jobs: | ||
publish-npm: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
registry-url: https://registry.npmjs.org/ | ||
- run: git config --global user.name "GitHub CD bot" | ||
- run: git config --global user.email "[email protected]" | ||
- name: Install deps | ||
run: npm i -g wait-for-localhost-cli && npm i | ||
- name: Start app and run tests | ||
run: npm run serve & wait-for-localhost 8080; cd test/e2e; npm i && npx playwright install chromium && npm run test | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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 |
---|---|---|
|
@@ -24,3 +24,8 @@ yarn-error.log* | |
/dist_electron | ||
|
||
package-lock.json | ||
|
||
|
||
test/e2e/node_modules | ||
test/e2e/yarn.lock | ||
test/e2e/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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export const config: CodeceptJS.MainConfig = { | ||
tests: './*_test.ts', | ||
output: './output', | ||
helpers: { | ||
Playwright: { | ||
browser: 'chromium', | ||
url: 'http://localhost:8080', | ||
show: false, | ||
timeout: 10000, | ||
waitForNavigation: 'load', | ||
waitForTimeout: 10000 | ||
} | ||
}, | ||
include: { | ||
I: './steps_file' | ||
}, | ||
name: 'e2e' | ||
} |
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,10 @@ | ||
const { I } = inject(); | ||
|
||
Feature('homepage'); | ||
|
||
|
||
Scenario('Home page is loaded', () => { | ||
I.amOnPage(''); | ||
I.waitForText('Write a 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "e2e", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "npx codeceptjs run --verbose" | ||
}, | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"codeceptjs": "^3.5.14", | ||
"playwright": "^1.41.2" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "20.11.20", | ||
"ts-node": "10.9.2", | ||
"typescript": "5.3.3" | ||
} | ||
} |
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,11 @@ | ||
/// <reference types='codeceptjs' /> | ||
type steps_file = typeof import('./steps_file'); | ||
|
||
declare namespace CodeceptJS { | ||
interface SupportObject { I: I, current: any } | ||
interface Methods extends Playwright {} | ||
interface I extends ReturnType<steps_file> {} | ||
namespace Translation { | ||
interface Actions {} | ||
} | ||
} |
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,10 @@ | ||
// in this file you can append custom step methods to 'I' object | ||
|
||
export = function() { | ||
return actor({ | ||
|
||
// Define custom steps here, use 'this' to access default methods of I. | ||
// It is recommended to place a general 'login' function here. | ||
|
||
}); | ||
} |
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,16 @@ | ||
{ | ||
"ts-node": { | ||
"files": true | ||
}, | ||
"compilerOptions": { | ||
"target": "es2018", | ||
"lib": ["es2018", "DOM"], | ||
"esModuleInterop": true, | ||
"module": "commonjs", | ||
"strictNullChecks": false, | ||
"types": ["codeceptjs", "node"], | ||
"declaration": true, | ||
"skipLibCheck": true | ||
}, | ||
"exclude": ["node_modules"] | ||
} |