Skip to content

Commit

Permalink
Merge pull request #691 from visualize-admin/fix/cypress-tests
Browse files Browse the repository at this point in the history
Fix cypress tests
  • Loading branch information
ptbrowne authored Sep 8, 2022
2 parents 2875f85 + 8198a9e commit d473312
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 15 deletions.
33 changes: 23 additions & 10 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,26 @@ jobs:
start: "env PORT=3333 npm run start"
wait-on: "https://localhost:3333"
record: false
- name: Set argos upload branch on master branch
run: echo "ARGOS_BRANCH=master" >> $GITHUB_ENV
if: github.ref == 'refs/heads/main'
- name: Set argos upload branch on PR branches
run: echo "ARGOS_BRANCH=$GITHUB_HEAD_REF" >> $GITHUB_ENV
if: github.ref != 'refs/heads/main'
- name: Upload screenshots
env:
ARGOS_TOKEN: ${{ secrets.ARGOS_TOKEN }}
run: yarn run argos upload --commit $GITHUB_SHA --branch $ARGOS_BRANCH cypress/screenshots
- name: Upload Cypress screenshots
uses: actions/upload-artifact@v2
if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots
# Test run video was always captured, so this action uses "always()" condition
- name: Upload Cypress videos
uses: actions/upload-artifact@v2
if: always()
with:
name: cypress-videos
path: cypress/videos
# - name: Set argos upload branch on master branch
# run: echo "ARGOS_BRANCH=master" >> $GITHUB_ENV
# if: github.ref == 'refs/heads/main'
# - name: Set argos upload branch on PR branches
# run: echo "ARGOS_BRANCH=$GITHUB_HEAD_REF" >> $GITHUB_ENV
# if: github.ref != 'refs/heads/main'
# - name: Upload screenshots
# env:
# ARGOS_TOKEN: ${{ secrets.ARGOS_TOKEN }}
# run: yarn run argos upload --commit $GITHUB_SHA --branch $ARGOS_BRANCH cypress/screenshots
8 changes: 3 additions & 5 deletions cypress/integration/edition.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,9 @@ describe("Editing a chart", () => {
cy.findByText("Filters", {
selector: "button",
}).click();
cy.findByText("Military defence").click();
cy.findByText("Civil defence").click();
cy.findByText("Mining, manufacturing and construction").click();
cy.findByText("Transport").click();
cy.findByText("Communication").click();
cy.findByText("Economic affairs").click();
cy.findByText("Social protection").click();
cy.findByText("Health").click();
cy.findByText("Apply filters").click();

cy.get('[data-name="panel-middle"]').scrollTo(0, 200, {
Expand Down

1 comment on commit d473312

@vercel
Copy link

@vercel vercel bot commented on d473312 Sep 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

visualization-tool – ./

visualization-tool-alpha.vercel.app
visualization-tool-git-main-ixt1.vercel.app
visualization-tool-ixt1.vercel.app

Please sign in to comment.