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

WIP: Config synpress ci #293

Closed
wants to merge 2 commits into from
Closed
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
20 changes: 19 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
pull_request:

jobs:
test:
test-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -18,3 +18,21 @@ jobs:
run: npm ci
- name: build
run: npm run build

test-synpress-e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Set Environment Variables
run: |
echo "NETWORK_NAME=mainnet" >> $GITHUB_ENV
echo "SECRET_WORDS="blade blade harbor surface since fossil say police pool ribbon degree endorse"" >> $GITHUB_ENV
- name: synpress-e2e
run: npm run synpress

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ dist
dist-ssr
*.local

cypress/videos
# Editor directories and files
.vscode/*
!.vscode/extensions.json
Expand Down
1 change: 1 addition & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { defineConfig } from 'cypress';
import getCompareSnapshotsPlugin from 'cypress-image-diff-js/dist/plugin';

export default defineConfig({
video: false,
env: {
browserPermissions: {
clipboard: 'allow',
Expand Down
32 changes: 32 additions & 0 deletions cypress/e2e/login.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
describe('Bridge | Connect | MestaMask | Connect', () => {
afterEach(() => {
cy.disconnectMetamaskWalletFromDapp();
});
it('it should connect with MM and switch the network automatically', () => {
cy.visit('http://localhost:8080');

cy.get('[data-testid="connect-wallet-button"]').click();

cy.get('[ data-testid="connect-metamask-button"]').click();

cy.get('div').contains('MetaMask').click();

cy.acceptMetamaskAccess({ switchNetwork: true }).should('be.true');
});

it('should change to sepolia network and connect', () => {
cy.visit('http://localhost:8080');
cy.changeMetamaskNetwork('sepolia');

cy.get('[data-testid="connect-wallet-button"]')
.contains('Connect wallets')
.click();

cy.get('[ data-testid="connect-metamask-button"]').click();

cy.get('div').contains('MetaMask').click();

cy.acceptMetamaskAccess().should('be.true');
cy.get('[data-testid="tag"]').contains('Connected');
});
});
11 changes: 11 additions & 0 deletions cypress/plugins/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* eslint-disable import/no-extraneous-dependencies */
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import synpressPlugins from '@synthetixio/synpress/plugins';
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const pluginsConfig = (on, config) => {
synpressPlugins(on, config);
};

export default pluginsConfig;
1 change: 1 addition & 0 deletions cypress/support/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

// Import commands.js using ES2015 syntax:
import './commands';
import '@synthetixio/synpress/support';

// Alternatively you can use CommonJS syntax:
// require('./commands')
Loading
Loading