Skip to content

Commit

Permalink
test: debug CI cypress tests
Browse files Browse the repository at this point in the history
  • Loading branch information
BCerki committed Jul 20, 2023
1 parent eecb404 commit 665f38c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ jobs:
uses: ./.github/actions/dev-env-setup
- name: run app locally
uses: ./.github/actions/local-app-run
- name: run e2e tests
- name: Cypress run with env
uses: cypress-io/github-action@v5
env:
CYPRESS_TEST_INTERNAL_USERNAME: ${{ secrets.TEST_INTERNAL_USERNAME }}
CYPRESS_TEST_INTERNAL_PASSWORD: ${{ secrets.TEST_INTERNAL_PASSWORD }}
Expand All @@ -181,7 +182,15 @@ jobs:
CYPRESS_TEST_UNAUTHORIZED_PASSWORD: ${{ secrets.TEST_UNAUTHORIZED_PASSWORD }}
HAPPO_API_KEY: ${{ secrets.HAPPO_API_KEY }}
HAPPO_API_SECRET: ${{ secrets.HAPPO_API_SECRET }}
run: yarn test:e2e
- name: artifacts
uses: actions/upload-artifact@v3
# add the line below to store screenshots only on failures
# if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots
if-no-files-found: ignore # 'warn' or 'error' are also available, defaults to `warn`
# run: yarn test:e2e
working-directory: ./app

zap-owasp:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ describe("when creating a project, the project page", () => {
beforeEach(() => {
cy.intercept("POST", "http://localhost:3004/graphql", (req) => {
aliasOperation(req, "addProjectAttachmentToRevisionMutation");
// aliasOperation(req, "createAttachmentMutation");
});
cy.useMockedTime(new Date("June 10, 2020 09:00:00"));
cy.sqlFixture("e2e/dbReset");
Expand Down Expand Up @@ -176,10 +177,12 @@ describe("when creating a project, the project page", () => {

cy.fixture("e2e/mock.pdf").as("mockFile");
cy.get("input[type=file]").selectFile("@mockFile");
// cy.wait("@gqladdProjectAttachmentToRevisionMutation")
// .its("response")
// .should("have.property", "body");
cy.wait(10000);
cy.screenshot();

cy.wait("@gqladdProjectAttachmentToRevisionMutation")
.its("response")
.should("have.property", "body");
// cy.wait(10000);
cy.findByText("mock.pdf").should("be.visible");

cy.findByText(/Submit project attachments/i).click();
Expand Down

0 comments on commit 665f38c

Please sign in to comment.