This repository has been archived by the owner on Nov 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
started work on E2E Tests #298
Merged
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
d156603
added first e2e tests
DerMolly 365aa44
finished Intro Links e2e tests
DerMolly af0cf2b
added e2e tests for intro and history functionality
DerMolly 2c40dd5
added github actions run
DerMolly 2cd856c
moved e2e test in own workflow
DerMolly cc280d5
workd on e2e workflow
DerMolly 5e43685
server gets run and then tested
DerMolly 67b6b77
everything is now in typescript
DerMolly 68f22fe
changed e2e workflow
DerMolly 206c94c
changed cache name
DerMolly 6d56b46
added sudo to apt-get
DerMolly 6321eca
fixed name of e2e:chromium
DerMolly b38ff4a
changed package.json scripts
DerMolly 110aec0
removed delay from config call
DerMolly 393d0c8
updated README
DerMolly 7fec204
updated README
DerMolly 1b45f83
try using webpack for CI runs
DerMolly e326c0c
removed explicit webpack dependency
DerMolly 4a85605
changed browser chrome
DerMolly 610efa8
removed cypress folder from tsconfig.json
DerMolly febeef6
parallelize chrome and firefox e2e test
DerMolly 6aa805e
changed names of paralleled chrome and firefox e2e runs
DerMolly edba048
try to fix firefox
DerMolly 3f12ce1
removed unit testing section from readme
DerMolly c82a2de
reworded some test descriptions
DerMolly 8f34d88
used more newlines in the tests
DerMolly bcdd3ef
removed unnecessary id's
DerMolly ecd8609
e2e workflow now uses matrix strategy
DerMolly 3b5c27a
added branding to config mock call
DerMolly 5aafe0e
added cypress badge to README
DerMolly 8c4c0f2
added suggestion from review
DerMolly 16faf49
fixed language e2e test, not everyone's system is in english...
DerMolly File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: e2e | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
branches: [master] | ||
|
||
jobs: | ||
end2end: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
browser: ['e2e:chrome', 'e2e:firefox'] | ||
name: ${{ matrix.browser }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Cache node_modules | ||
uses: actions/cache@v1.1.0 | ||
with: | ||
path: node_modules | ||
key: node_modules | ||
- name: Cache ~/.cache | ||
uses: actions/cache@v1.1.0 | ||
with: | ||
path: ~/.cache | ||
key: cache | ||
- name: install cypress dependencies | ||
run: sudo apt-get install libgtk2.0-0 libgtk-3-0 libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb | ||
- name: Install dependencies | ||
run: yarn install | ||
- name: Run e2e in chrome | ||
run: yarn ${{ matrix.browser }} |
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,8 @@ | ||
{ | ||
"baseUrl": "http://localhost:3000/", | ||
"experimentalFetchPolyfill": true, | ||
"firefoxGcInterval": { | ||
"runMode": null, | ||
"openMode": null | ||
DerMolly marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} |
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 @@ | ||
{ | ||
"parserOptions": { | ||
"tsconfigRootDir": "", | ||
"project": [ | ||
"./cypress/tsconfig.json" | ||
] | ||
}, | ||
"plugins": [ | ||
"cypress", | ||
"chai-friendly" | ||
], | ||
"extends": [ | ||
"plugin:cypress/recommended" | ||
], | ||
"rules": { | ||
"@typescript-eslint/no-unused-expressions": 0, | ||
"no-unused-expressions": 0, | ||
"chai-friendly/no-unused-expressions": 2 | ||
}, | ||
"env": { | ||
"cypress/globals": true | ||
} | ||
} |
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,30 @@ | ||
export const languages: string[] = [ | ||
'English', | ||
'简体中文', | ||
'繁體中文', | ||
'Français', | ||
'Deutsch', | ||
'日本語', | ||
'Español', | ||
'Català', | ||
'Ελληνικά', | ||
'Português', | ||
'Italiano', | ||
'Türkçe', | ||
'Русский', | ||
'Nederlands', | ||
'Hrvatski', | ||
'Polski', | ||
'Українська', | ||
'हिन्दी', | ||
'Svenska', | ||
'Esperanto', | ||
'Dansk', | ||
'한국어', | ||
'Bahasa Indonesia', | ||
'Cрпски', | ||
'Tiếng Việt', | ||
'العربية', | ||
'Česky', | ||
'Slovensky' | ||
] |
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,26 @@ | ||
import { banner } from '../support/config' | ||
|
||
describe('Banner', () => { | ||
beforeEach(() => { | ||
cy.visit('/') | ||
expect(localStorage.getItem('bannerTimeStamp')).to.be.null | ||
}) | ||
|
||
it('shows the correct alert banner text', () => { | ||
cy.get('.alert-primary.show') | ||
.contains(banner.text) | ||
}) | ||
|
||
it('can be dismissed', () => { | ||
cy.get('.alert-primary.show') | ||
.contains(banner.text) | ||
cy.get('.alert-primary.show') | ||
.find('.fa-times') | ||
.click() | ||
.then(() => { | ||
expect(localStorage.getItem('bannerTimeStamp')).to.equal(banner.timestamp) | ||
}) | ||
cy.get('.alert-primary.show') | ||
.should('not.exist') | ||
}) | ||
}) |
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,35 @@ | ||
describe('History', () => { | ||
beforeEach(() => { | ||
cy.visit('/history') | ||
}) | ||
|
||
describe('History Mode', () => { | ||
it('Cards', () => { | ||
cy.get('div.card') | ||
}) | ||
|
||
it('Table', () => { | ||
cy.get('i.fa-table') | ||
.click() | ||
cy.get('table.history-table') | ||
}) | ||
}) | ||
|
||
describe('Pinning', () => { | ||
it('Cards', () => { | ||
cy.get('.fa-thumb-tack') | ||
.first() | ||
.click() | ||
cy.get('.modal-dialog') | ||
.should('be.visible') | ||
}) | ||
|
||
it('Table', () => { | ||
cy.get('.fa-thumb-tack') | ||
.first() | ||
.click() | ||
cy.get('.modal-dialog') | ||
.should('be.visible') | ||
}) | ||
}) | ||
}) |
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,58 @@ | ||
/* eslint-disable @typescript-eslint/no-unsafe-call */ | ||
describe('Intro', () => { | ||
beforeEach(() => { | ||
cy.visit('/') | ||
}) | ||
|
||
describe('Cover Button are hidden when logged in', () => { | ||
it('Sign in Cover Button', () => { | ||
cy.get('.cover-button.btn-success') | ||
.should('not.exist') | ||
}) | ||
|
||
it('Features Cover Button', () => { | ||
cy.get('.cover-button.btn-primary') | ||
.should('not.exist') | ||
}) | ||
}) | ||
|
||
describe('Cover Button are shown when logged out', () => { | ||
beforeEach(() => { | ||
cy.logout() | ||
}) | ||
|
||
it('Sign in Cover Button', () => { | ||
cy.get('.cover-button.btn-success') | ||
.should('exist') | ||
}) | ||
|
||
it('Features Cover Button', () => { | ||
cy.get('.cover-button.btn-primary') | ||
.should('exist') | ||
}) | ||
}) | ||
|
||
describe('Version', () => { | ||
it('can be opened', () => { | ||
cy.get('#versionModal') | ||
.should('not.be.visible') | ||
cy.get('#version') | ||
.click() | ||
cy.get('#versionModal') | ||
.should('be.visible') | ||
}) | ||
|
||
it('can be closed', () => { | ||
cy.get('#versionModal') | ||
.should('not.be.visible') | ||
cy.get('#version') | ||
.click() | ||
cy.get('#versionModal') | ||
.should('be.visible') | ||
cy.get('body') | ||
.click() | ||
cy.get('#versionModal') | ||
.should('not.be.visible') | ||
}) | ||
}) | ||
}) |
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,30 @@ | ||
import { languages } from '../fixtures/languages' | ||
|
||
describe('Languages', () => { | ||
beforeEach(() => { | ||
cy.visit('/') | ||
}) | ||
|
||
it('all languages are available', () => { | ||
cy.get('option') | ||
.as('languages') | ||
cy.get('@languages') | ||
.should('have.length', 28) | ||
languages.forEach(language => { | ||
cy.get('@languages').contains(language) | ||
}) | ||
}) | ||
|
||
it('language changes affect the UI', () => { | ||
cy.get('select') | ||
.select('English') | ||
cy.get('.d-inline-flex.btn-primary') | ||
.find('span') | ||
.contains('New note') | ||
cy.get('select') | ||
.select('Deutsch') | ||
cy.get('.d-inline-flex.btn-primary') | ||
.find('span') | ||
.contains('Neue Notiz') | ||
}) | ||
}) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like both jobs are the same, but the browser. How about the matrix strategy, like we used in the build job?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can I use the matrix parameters just in
with
statements?Or should this also work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use it everywhere, where you want to insert a value. (please remember changing the job names, too)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done