Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Argos test #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
node-version: ${{ env.NODE_VERSION }}
start-strategy: ${{ matrix.start_strategy }}
spec-relative-path: ${{ matrix.test_spec }}
# - run: npm exec -- argos upload --token ${{ secrets.ARGOS_TOKEN }} cypress/screenshots
- run: npm exec -- argos upload --token ${{ secrets.ARGOS_TOKEN }} cypress/screenshots

documentation-ci-cd:
name: Test and Deploy Documentation to GitHub Pages
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ React Template <sup>![Node Version Badge is Missing][node version badge]</sup>

[![License Badge][license badge]](https://www.apache.org/licenses/LICENSE-2.0)
![GitHub last commit (master)](https://img.shields.io/github/last-commit/QubitPi/react-template/master?logo=github&style=for-the-badge)
[![Covered by Argos Visual Testing](https://argos-ci.com/badge.svg)](https://app.argos-ci.com/qubitpi/react-template/reference)

License
-------
Expand Down
21 changes: 21 additions & 0 deletions cypress/e2e/screenshot.spec.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright 2023 Paion Data. All rights reserved.

import "@argos-ci/cypress/support";

describe("Argos tests", () => {
beforeEach(() => {
cy.visit("http://localhost:3000/");
});

it("test", () => {
const baseUrl = "http://localhost:3000";
const pages = [{ name: "homepage", path: "/" }];

for (const { name, path } of pages) {
it(`Screenshots for ${name}`, () => {
cy.visit(`${baseUrl}${path}`);
cy.argosScreenshot(name);
});
}
});
});
2 changes: 1 addition & 1 deletion cypress/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"target": "es5",
"lib": ["es5", "dom"],
"types": ["cypress", "node"],
"types": ["cypress", "@argos-ci/cypress", "node"],
"strictNullChecks": true
},
"include": ["**/*.ts"]
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@argos-ci/cli": "^1.0.4",
"@argos-ci/cypress": "^1.2.2",
"@babel/cli": "^7.23.4",
"@babel/core": "^7.23.6",
"@babel/preset-env": "^7.23.6",
Expand Down
Loading