-
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.
test: installing cypress and setting up basic ci check
- Loading branch information
1 parent
334a5a4
commit 18a02ba
Showing
8 changed files
with
735 additions
and
20 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,34 @@ | ||
name: e2e Tests | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
jobs: | ||
test: | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
node-version: [16] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Use Node ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Install Angular | ||
run: npm install -g @angular/cli | ||
- name: Install Dependencies | ||
run: yarn install | ||
- name: Build ngx-turnstile | ||
run: ng build ngx-turnstile | ||
- name: Run Cypress for environment | ||
uses: cypress-io/github-action@v2 | ||
with: | ||
start: | | ||
ng serve ngx-turnstile-demo | ||
wait-on: "http://localhost:4200" | ||
wait-on-timeout: 300 | ||
browser: chrome | ||
config-file: cypress.config.ts |
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,6 @@ | ||
{ | ||
"editor.tokenColorCustomizations": { | ||
"comments": "", | ||
"textMateRules": [] | ||
} | ||
} |
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,21 @@ | ||
import { defineConfig } from 'cypress'; | ||
|
||
export default defineConfig({ | ||
component: { | ||
devServer: { | ||
framework: 'angular', | ||
bundler: 'webpack', | ||
}, | ||
specPattern: '**/*.cy.ts', | ||
}, | ||
env: { | ||
baseUrl: 'http://localhost:4200', | ||
reactiveFormUrl: 'http://localhost:4200/reactive-form-example', | ||
templateDrivenFormUrl: 'http://localhost:4200/template-driven-form-example', | ||
}, | ||
e2e: { | ||
setupNodeEvents(on, config) { | ||
// implement node event listeners 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,15 @@ | ||
describe('tests the ngx-turnstile library', () => { | ||
// visits the Reactive Form Example route and makes sure the Successful DUMMY TOKEN is generated | ||
it('Passes Reactive Form Example', () => { | ||
cy.visit(Cypress.env('reactiveFormUrl')); | ||
cy.wait(3000); | ||
cy.contains('Value: XXXX.DUMMY.TOKEN.XXXX'); | ||
}); | ||
|
||
// visits the Template Driven Form Example route and makes sure the Successful DUMMY TOKEN is generated | ||
it('Passes Template Driven Form Example', () => { | ||
cy.visit(Cypress.env('templateDrivenFormUrl')); | ||
cy.wait(3000); | ||
cy.contains('Value: XXXX.DUMMY.TOKEN.XXXX'); | ||
}); | ||
}); |
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 @@ | ||
/// <reference types="cypress" /> |
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,2 @@ | ||
// Import commands.js using ES2015 syntax: | ||
import './commands'; |
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