-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test Baikal initialisation with Cypress (#74)
* Added Cypress test to verify initial Baikal setup * Test all image variants * Perform tests on on PRs Co-authored-by: ckulka <ckulka@wlgore.com>
- Loading branch information
Showing
8 changed files
with
5,394 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,14 @@ | ||
# See https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/README.md | ||
root: true | ||
extends: | ||
- prettier | ||
parser: "@typescript-eslint/parser" | ||
parserOptions: | ||
ecmaVersion: 2019 | ||
sourceType: module | ||
plugins: | ||
- "@typescript-eslint" | ||
- prettier | ||
rules: | ||
prettier/prettier: | ||
- error |
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,45 @@ | ||
name: test | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- .github/workflows/docker-test.yml | ||
- "*.dockerfile" | ||
- cypress/* | ||
- cypress.json | ||
- files/* | ||
- package.json | ||
- package-lock.json | ||
|
||
jobs: | ||
test: | ||
name: Test Docker image | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
dockerfile: [apache, apache-php8.0, nginx, nginx-php8.0] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: "16" | ||
|
||
- name: Install Cypress dependencies | ||
run: npm ci | ||
|
||
- name: Build and start Baikal | ||
run: docker run --rm -dp 80:80 $(docker build -qf ${{ matrix.dockerfile }}.dockerfile .) | ||
|
||
- name: Run Cypress tests | ||
run: npm run test | ||
|
||
- name: Archive test results | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: cypress-results-${{ matrix.dockerfile }} | ||
path: | | ||
cypress/screenshots | ||
cypress/videos |
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 |
---|---|---|
@@ -1 +1,26 @@ | ||
docker-compose.override.yml | ||
|
||
# Apple | ||
*.DS_Store | ||
.DS_Store | ||
|
||
# Cypress | ||
cypress/screenshots | ||
cypress/videos | ||
cypress/logs | ||
# Currently not needed | ||
cypress/plugins/ | ||
cypress/support/ | ||
|
||
# Node (see https://github.com/github/gitignore/blob/master/Node.gitignore) | ||
.npm/ | ||
build/ | ||
dist/ | ||
**/node_modules/ | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# Visual Studio Code (see https://github.com/github/gitignore/blob/master/Global/VisualStudioCode.gitignore) | ||
.vscode/ | ||
*.code-workspace | ||
.history/ |
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 @@ | ||
{} |
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,33 @@ | ||
describe("Create Baikal instance", () => { | ||
it("Should initialise administrator password", () => { | ||
cy.visit("localhost"); | ||
|
||
cy.get("#overview > h1").should( | ||
"have.text", | ||
"Baïkal initialization wizard" | ||
); | ||
cy.get("#admin_passwordhash").type("asdasd"); | ||
cy.get("#admin_passwordhash_confirm").type("asdasd"); | ||
cy.get("button[type='submit']").click(); | ||
}); | ||
|
||
it("Should initialise database", () => { | ||
cy.get("#overview > h1").should("have.text", "Baïkal Database setup"); | ||
cy.get("button[type='submit']").click(); | ||
}); | ||
|
||
it("Should start Baikal", () => { | ||
cy.get("a.btn.btn-success") | ||
.should("have.text", "Start using Baïkal") | ||
.click(); | ||
}); | ||
|
||
it("Should sign in as administrator", () => { | ||
cy.get("input[name='password']").type("asdasd"); | ||
cy.get("button[type='submit']").should("have.text", "Authenticate").click(); | ||
}); | ||
|
||
it("Should show dashboard", () => { | ||
cy.get("#overview > h1").should("have.text", "Dashboard"); | ||
}); | ||
}); |
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 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es5", | ||
"lib": ["es5", "dom"], | ||
"types": ["cypress"] | ||
}, | ||
"include": ["**/*.ts"] | ||
} |
Oops, something went wrong.