Skip to content

Commit a88df67

Browse files
committed
test: ensure that connected before making screenshot
1 parent 702e5b6 commit a88df67

13 files changed

+10
-5
lines changed

Diff for: .github/workflows/test.yml

+2-5
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,21 @@ on: [pull_request]
33
jobs:
44
main:
55
runs-on: ubuntu-latest
6-
env:
7-
CYPRESS_PLUGIN_VISUAL_REGRESSION_UPDATE_IMAGES: ${{ contains(github.event.head_commit.message, ' [update screenshots]') }}
86
steps:
97
- uses: actions/checkout@v3
108
with:
119
ref: ${{ github.head_ref }}
1210
- uses: actions/setup-node@v3
1311
with:
14-
# TODO: update to 18 after updating cypress
15-
node-version: 16.x
12+
node-version: 18.x
1613
- uses: actions/cache@v3
1714
with:
1815
path: ~/.npm
1916
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
2017
- run: npm ci --legacy-peer-deps # TODO: remove --legacy-peer-deps after updating dependencies
2118
- run: npm test
2219
- uses: stefanzweifel/git-auto-commit-action@v4
23-
if: ${{ env.CYPRESS_PLUGIN_VISUAL_REGRESSION_UPDATE_IMAGES == true }}
20+
if: failure()
2421
with:
2522
commit_message: "chore: update e2e screenshots"
2623
file_pattern: 'tests/e2e/*.png'
Binary file not shown.
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Binary file not shown.
Loading

Diff for: tests/e2e/support/commands.js

+8
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,11 @@ Cypress.Commands.overwrite('visit', (originalFn, url, options = {}) => originalF
7777
));
7878

7979
Cypress.Commands.add('getState', () => JSON.parse(localStorage.vuex));
80+
81+
Cypress.Commands.overwrite('matchImage', (originalFn, ...args) => {
82+
cy.get('body').then(($body) => {
83+
if ($body.find('.connection-status.connecting').length === 0) return;
84+
cy.get('.connection-status.test-net').should('be.visible');
85+
});
86+
originalFn(...args);
87+
});

0 commit comments

Comments
 (0)