Test/783 cypress tags (#1428)
* test: add tags for slow tests * chore: remove old flows * test: added smoke tags to view tests * test: add tags for trading tests * test: tags for explorer tests added * chore: add tags to remaining tests and tidy files * chore: pass env in test command * chore: fix build errors * chore: re-add teardown for manual flow * chore: ability to only run smoke tests in manual flow * chore: fix manual input flow
This commit is contained in:
parent
c3cdcede9f
commit
ac16ca9ee5
@ -15,11 +15,11 @@ on:
|
|||||||
- stats-e2e
|
- stats-e2e
|
||||||
- token-e2e
|
- token-e2e
|
||||||
- trading-e2e
|
- trading-e2e
|
||||||
includeFlows:
|
runAlltests:
|
||||||
description: 'Include long flows (if any)?'
|
description: 'Run only smoke tests?'
|
||||||
required: true
|
required: true
|
||||||
type: boolean
|
type: boolean
|
||||||
default: true
|
default: false
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
manual:
|
manual:
|
||||||
@ -160,14 +160,24 @@ jobs:
|
|||||||
run: yarn install
|
run: yarn install
|
||||||
working-directory: frontend-monorepo
|
working-directory: frontend-monorepo
|
||||||
|
|
||||||
|
- name: Run smoke Cypress tests
|
||||||
|
if: ${{ github.event.inputs.runAlltests == 'true' }}
|
||||||
|
run: yarn nx run ${{ github.event.inputs.project }}:e2e --record --key ${{ secrets.CYPRESS_RECORD_KEY }} --env.grepTags='@smoke'
|
||||||
|
working-directory: frontend-monorepo
|
||||||
|
env:
|
||||||
|
CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE: ${{ secrets.CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE }}
|
||||||
|
CYPRESS_SLACK_WEBHOOK: ${{ secrets.CYPRESS_SLACK_WEBHOOK }}
|
||||||
|
CYPRESS_ETH_WALLET_MNEMONIC: ${{ secrets.CYPESS_ETH_WALLET_MNEMONIC }}
|
||||||
|
CYPRESS_TEARDOWN_NETWORK_AFTER_FLOWS: true
|
||||||
|
|
||||||
- name: Run Cypress tests
|
- name: Run Cypress tests
|
||||||
|
if: ${{ github.event.inputs.runAlltests == 'false' }}
|
||||||
run: yarn nx run ${{ github.event.inputs.project }}:e2e --record --key ${{ secrets.CYPRESS_RECORD_KEY }}
|
run: yarn nx run ${{ github.event.inputs.project }}:e2e --record --key ${{ secrets.CYPRESS_RECORD_KEY }}
|
||||||
working-directory: frontend-monorepo
|
working-directory: frontend-monorepo
|
||||||
env:
|
env:
|
||||||
CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE: ${{ secrets.CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE }}
|
CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE: ${{ secrets.CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE }}
|
||||||
CYPRESS_SLACK_WEBHOOK: ${{ secrets.CYPRESS_SLACK_WEBHOOK }}
|
CYPRESS_SLACK_WEBHOOK: ${{ secrets.CYPRESS_SLACK_WEBHOOK }}
|
||||||
CYPRESS_ETH_WALLET_MNEMONIC: ${{ secrets.CYPESS_ETH_WALLET_MNEMONIC }}
|
CYPRESS_ETH_WALLET_MNEMONIC: ${{ secrets.CYPESS_ETH_WALLET_MNEMONIC }}
|
||||||
CYPRESS_INCLUDE_FLOWS: ${{ github.event.inputs.includeFlows }}
|
|
||||||
CYPRESS_TEARDOWN_NETWORK_AFTER_FLOWS: true
|
CYPRESS_TEARDOWN_NETWORK_AFTER_FLOWS: true
|
||||||
|
|
||||||
######
|
######
|
||||||
|
@ -124,7 +124,6 @@ jobs:
|
|||||||
CYPRESS_SLACK_WEBHOOK: ${{ secrets.CYPRESS_SLACK_WEBHOOK }}
|
CYPRESS_SLACK_WEBHOOK: ${{ secrets.CYPRESS_SLACK_WEBHOOK }}
|
||||||
CYPRESS_ETH_WALLET_MNEMONIC: ${{ secrets.CYPESS_ETH_WALLET_MNEMONIC }}
|
CYPRESS_ETH_WALLET_MNEMONIC: ${{ secrets.CYPESS_ETH_WALLET_MNEMONIC }}
|
||||||
CYPRESS_NIGHTLY_RUN: true
|
CYPRESS_NIGHTLY_RUN: true
|
||||||
CYPRESS_INCLUDE_FLOWS: true
|
|
||||||
CYPRESS_TEARDOWN_NETWORK_AFTER_FLOWS: true
|
CYPRESS_TEARDOWN_NETWORK_AFTER_FLOWS: true
|
||||||
|
|
||||||
######
|
######
|
||||||
|
3
.github/workflows/capsule-cypress.yml
vendored
3
.github/workflows/capsule-cypress.yml
vendored
@ -157,13 +157,12 @@ jobs:
|
|||||||
main-branch-name: ${{github.base_ref}}
|
main-branch-name: ${{github.base_ref}}
|
||||||
|
|
||||||
- name: Run Cypress tests
|
- name: Run Cypress tests
|
||||||
run: npx nx affected:e2e --record --key ${{ secrets.CYPRESS_RECORD_KEY }}
|
run: npx nx affected:e2e --record --key ${{ secrets.CYPRESS_RECORD_KEY }} --env.grepTags='@smoke'
|
||||||
working-directory: frontend-monorepo
|
working-directory: frontend-monorepo
|
||||||
env:
|
env:
|
||||||
CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE: ${{ secrets.CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE }}
|
CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE: ${{ secrets.CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE }}
|
||||||
CYPRESS_SLACK_WEBHOOK: ${{ secrets.CYPRESS_SLACK_WEBHOOK }}
|
CYPRESS_SLACK_WEBHOOK: ${{ secrets.CYPRESS_SLACK_WEBHOOK }}
|
||||||
CYPRESS_ETH_WALLET_MNEMONIC: ${{ secrets.CYPESS_ETH_WALLET_MNEMONIC }}
|
CYPRESS_ETH_WALLET_MNEMONIC: ${{ secrets.CYPESS_ETH_WALLET_MNEMONIC }}
|
||||||
CYPRESS_INCLUDE_FLOWS: false
|
|
||||||
CYPRESS_TEARDOWN_NETWORK_AFTER_FLOWS: true
|
CYPRESS_TEARDOWN_NETWORK_AFTER_FLOWS: true
|
||||||
|
|
||||||
######
|
######
|
||||||
|
@ -3,13 +3,17 @@ module.exports = defineConfig({
|
|||||||
projectId: 'et4snf',
|
projectId: 'et4snf',
|
||||||
|
|
||||||
e2e: {
|
e2e: {
|
||||||
|
setupNodeEvents(on, config) {
|
||||||
|
require('cypress-grep/src/plugin')(config);
|
||||||
|
return config;
|
||||||
|
},
|
||||||
baseUrl: 'http://localhost:4200',
|
baseUrl: 'http://localhost:4200',
|
||||||
fileServerFolder: '.',
|
fileServerFolder: '.',
|
||||||
fixturesFolder: false,
|
fixturesFolder: false,
|
||||||
specPattern: './src/integration/*.ts',
|
specPattern: './src/integration/*.ts',
|
||||||
excludeSpecPattern: '**/*.js',
|
excludeSpecPattern: '**/*.js',
|
||||||
modifyObstructiveCode: false,
|
modifyObstructiveCode: false,
|
||||||
supportFile: './src/support/index.ts',
|
supportFile: './src/support/index.js',
|
||||||
video: false,
|
video: false,
|
||||||
videoUploadOnPasses: false,
|
videoUploadOnPasses: false,
|
||||||
videosFolder: '../../dist/cypress/apps/console-lite-e2e/videos',
|
videosFolder: '../../dist/cypress/apps/console-lite-e2e/videos',
|
||||||
@ -35,5 +39,8 @@ module.exports = defineConfig({
|
|||||||
TRADING_TEST_VEGA_WALLET_PASSPHRASE: '123',
|
TRADING_TEST_VEGA_WALLET_PASSPHRASE: '123',
|
||||||
ETH_WALLET_MNEMONIC:
|
ETH_WALLET_MNEMONIC:
|
||||||
'ugly gallery notice network true range brave clarify flat logic someone chunk',
|
'ugly gallery notice network true range brave clarify flat logic someone chunk',
|
||||||
|
grepTags: '@regression @smoke @slow',
|
||||||
|
grepFilterSpecs: true,
|
||||||
|
grepOmitFiltered: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
describe('simple trading app', () => {
|
describe('simple trading app', { tags: '@smoke' }, () => {
|
||||||
beforeEach(() => cy.visit('/'));
|
beforeEach(() => cy.visit('/'));
|
||||||
|
|
||||||
it('render', () => {
|
it('render', () => {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
describe('console lite header', () => {
|
describe('console lite header', { tags: '@smoke' }, () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
window.localStorage.setItem('theme', 'dark');
|
window.localStorage.setItem('theme', 'dark');
|
||||||
cy.visit('/');
|
cy.visit('/');
|
||||||
|
@ -7,7 +7,7 @@ import {
|
|||||||
generateMarketsCandles,
|
generateMarketsCandles,
|
||||||
} from '../support/mocks/generate-markets';
|
} from '../support/mocks/generate-markets';
|
||||||
|
|
||||||
describe('market list', () => {
|
describe('market list', { tags: '@smoke' }, () => {
|
||||||
describe('simple url', () => {
|
describe('simple url', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.mockGQL((req) => {
|
cy.mockGQL((req) => {
|
||||||
|
@ -16,7 +16,7 @@ import { generateMarketNames } from '../support/mocks/generate-market-names';
|
|||||||
import { generateMarketDepth } from '../support/mocks/generate-market-depth';
|
import { generateMarketDepth } from '../support/mocks/generate-market-depth';
|
||||||
import type { Market, Markets } from '@vegaprotocol/market-list';
|
import type { Market, Markets } from '@vegaprotocol/market-list';
|
||||||
|
|
||||||
describe('market selector', () => {
|
describe('market selector', { tags: '@smoke' }, () => {
|
||||||
let markets: Market[];
|
let markets: Market[];
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.mockGQL((req) => {
|
cy.mockGQL((req) => {
|
||||||
|
@ -15,7 +15,7 @@ import { generateMarketDepth } from '../support/mocks/generate-market-depth';
|
|||||||
import { connectVegaWallet } from '../support/connect-wallet';
|
import { connectVegaWallet } from '../support/connect-wallet';
|
||||||
import type { Markets, Market } from '@vegaprotocol/market-list';
|
import type { Markets, Market } from '@vegaprotocol/market-list';
|
||||||
|
|
||||||
describe('Market trade', () => {
|
describe('Market trade', { tags: '@smoke' }, () => {
|
||||||
let markets: Market[];
|
let markets: Market[];
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.mockGQL((req) => {
|
cy.mockGQL((req) => {
|
||||||
|
@ -9,7 +9,7 @@ import { generateOrders } from '../support/mocks/generate-orders';
|
|||||||
import { generateFills } from '../support/mocks/generate-fills';
|
import { generateFills } from '../support/mocks/generate-fills';
|
||||||
import { generateFillsMarkets } from '../support/mocks/generate-markets';
|
import { generateFillsMarkets } from '../support/mocks/generate-markets';
|
||||||
|
|
||||||
describe('Portfolio page', () => {
|
describe('Portfolio page', { tags: '@smoke' }, () => {
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
disconnectVegaWallet();
|
disconnectVegaWallet();
|
||||||
});
|
});
|
||||||
|
@ -17,3 +17,5 @@ import '@vegaprotocol/cypress';
|
|||||||
import 'cypress-real-events/support';
|
import 'cypress-real-events/support';
|
||||||
// Import commands.js using ES2015 syntax:
|
// Import commands.js using ES2015 syntax:
|
||||||
import './commands';
|
import './commands';
|
||||||
|
import registerCypressGrep from 'cypress-grep';
|
||||||
|
registerCypressGrep();
|
@ -6,7 +6,7 @@
|
|||||||
"allowSyntheticDefaultImports": true,
|
"allowSyntheticDefaultImports": true,
|
||||||
"outDir": "../../dist/out-tsc",
|
"outDir": "../../dist/out-tsc",
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
"types": ["cypress", "node", "cypress-real-events"]
|
"types": ["cypress", "node", "cypress-real-events", "cypress-grep"]
|
||||||
},
|
},
|
||||||
"include": ["src/**/*.ts", "src/**/*.js"]
|
"include": ["src/**/*.ts", "src/**/*.js"]
|
||||||
}
|
}
|
||||||
|
@ -4,12 +4,16 @@ module.exports = defineConfig({
|
|||||||
projectId: 'et4snf',
|
projectId: 'et4snf',
|
||||||
|
|
||||||
e2e: {
|
e2e: {
|
||||||
|
setupNodeEvents(on, config) {
|
||||||
|
require('cypress-grep/src/plugin')(config);
|
||||||
|
return config;
|
||||||
|
},
|
||||||
baseUrl: 'http://localhost:3000',
|
baseUrl: 'http://localhost:3000',
|
||||||
fileServerFolder: '.',
|
fileServerFolder: '.',
|
||||||
fixturesFolder: false,
|
fixturesFolder: false,
|
||||||
specPattern: '**/*.cy.{js,jsx,ts,tsx}',
|
specPattern: '**/*.cy.{js,jsx,ts,tsx}',
|
||||||
modifyObstructiveCode: false,
|
modifyObstructiveCode: false,
|
||||||
supportFile: './src/support/index.ts',
|
supportFile: './src/support/index.js',
|
||||||
video: false,
|
video: false,
|
||||||
videoUploadOnPasses: false,
|
videoUploadOnPasses: false,
|
||||||
videosFolder: '../../dist/cypress/apps/explorer-e2e/videos',
|
videosFolder: '../../dist/cypress/apps/explorer-e2e/videos',
|
||||||
@ -24,5 +28,8 @@ module.exports = defineConfig({
|
|||||||
ethUrl: 'https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8',
|
ethUrl: 'https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8',
|
||||||
commitHash: 'dev',
|
commitHash: 'dev',
|
||||||
tsConfig: 'tsconfig.json',
|
tsConfig: 'tsconfig.json',
|
||||||
|
grepTags: '@regression @smoke @slow',
|
||||||
|
grepFilterSpecs: true,
|
||||||
|
grepOmitFiltered: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import '../support/common.functions';
|
import '../support/common.functions';
|
||||||
|
|
||||||
context('Asset page', function () {
|
context('Asset page', { tags: '@regression' }, function () {
|
||||||
describe('Verify elements on page', function () {
|
describe('Verify elements on page', function () {
|
||||||
const assetsNavigation = 'a[href="/assets"]';
|
const assetsNavigation = 'a[href="/assets"]';
|
||||||
const assetHeader = '[data-testid="asset-header"]';
|
const assetHeader = '[data-testid="asset-header"]';
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import '../support/common.functions';
|
import '../support/common.functions';
|
||||||
|
|
||||||
context('Blocks page', function () {
|
context('Blocks page', { tags: '@regression' }, function () {
|
||||||
before('visit token home page', function () {
|
before('visit token home page', function () {
|
||||||
cy.visit('/');
|
cy.visit('/');
|
||||||
});
|
});
|
||||||
|
@ -3,7 +3,7 @@ context('Home Page', function () {
|
|||||||
cy.visit('/');
|
cy.visit('/');
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Stats page', function () {
|
describe('Stats page', { tags: '@smoke' }, function () {
|
||||||
const statsValue = '[data-testid="stats-value"]';
|
const statsValue = '[data-testid="stats-value"]';
|
||||||
|
|
||||||
it('Should show connected environment', function () {
|
it('Should show connected environment', function () {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import '../support/common.functions';
|
import '../support/common.functions';
|
||||||
|
|
||||||
//Tests set to skip until market bug for capsule checkpoint is fixed
|
//Tests set to skip until market bug for capsule checkpoint is fixed
|
||||||
context.skip('Market page', function () {
|
context.skip('Market page', { tags: '@regression' }, function () {
|
||||||
describe('Verify elements on page', function () {
|
describe('Verify elements on page', function () {
|
||||||
const marketHeaders = '[data-testid="markets-header"]';
|
const marketHeaders = '[data-testid="markets-header"]';
|
||||||
const marketNavigation = 'a[href="/markets"]';
|
const marketNavigation = 'a[href="/markets"]';
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import '../support/common.functions';
|
import '../support/common.functions';
|
||||||
|
|
||||||
context('Network parameters page', function () {
|
context('Network parameters page', { tags: '@smoke' }, function () {
|
||||||
before('visit token home page', function () {
|
before('visit token home page', function () {
|
||||||
cy.visit('/');
|
cy.visit('/');
|
||||||
});
|
});
|
||||||
|
@ -3,7 +3,7 @@ const nodeErrorMsg = 'node-error-message';
|
|||||||
const nodeId = 'node-url-0';
|
const nodeId = 'node-url-0';
|
||||||
const customNodeBtn = 'custom-node';
|
const customNodeBtn = 'custom-node';
|
||||||
|
|
||||||
context.skip('Node switcher', function () {
|
context.skip('Node switcher', { tags: '@regression' }, function () {
|
||||||
beforeEach('visit home page', function () {
|
beforeEach('visit home page', function () {
|
||||||
cy.intercept('GET', 'https://static.vega.xyz/assets/capsule-network.json', {
|
cy.intercept('GET', 'https://static.vega.xyz/assets/capsule-network.json', {
|
||||||
hosts: ['http://localhost:3028/query'],
|
hosts: ['http://localhost:3028/query'],
|
||||||
|
@ -4,7 +4,7 @@ context.skip('Transactions page', function () {
|
|||||||
cy.visit('/');
|
cy.visit('/');
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Verify elements on page', function () {
|
describe('Verify elements on page', { tags: '@regression' }, function () {
|
||||||
const transactionNavigation = 'a[href="/txs"]';
|
const transactionNavigation = 'a[href="/txs"]';
|
||||||
const transactionRow = 'transaction-row';
|
const transactionRow = 'transaction-row';
|
||||||
const txHash = 'hash';
|
const txHash = 'hash';
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import '../support/common.functions';
|
import '../support/common.functions';
|
||||||
|
|
||||||
context('Validator page', function () {
|
context('Validator page', { tags: '@smoke' }, function () {
|
||||||
describe('Verify elements on page', function () {
|
describe('Verify elements on page', function () {
|
||||||
const validatorNavigation = 'a[href="/validators"]';
|
const validatorNavigation = 'a[href="/validators"]';
|
||||||
|
|
||||||
|
2
apps/explorer-e2e/src/support/index.d.ts
vendored
2
apps/explorer-e2e/src/support/index.d.ts
vendored
@ -1,2 +0,0 @@
|
|||||||
// type definitions for Cypress object "cy"
|
|
||||||
/// <reference types="cypress" />
|
|
@ -14,3 +14,5 @@
|
|||||||
// ***********************************************************
|
// ***********************************************************
|
||||||
|
|
||||||
import '@vegaprotocol/cypress';
|
import '@vegaprotocol/cypress';
|
||||||
|
import registerCypressGrep from 'cypress-grep';
|
||||||
|
registerCypressGrep();
|
@ -4,7 +4,7 @@
|
|||||||
"jsx": "react-jsx",
|
"jsx": "react-jsx",
|
||||||
"sourceMap": false,
|
"sourceMap": false,
|
||||||
"outDir": "../../dist/out-tsc",
|
"outDir": "../../dist/out-tsc",
|
||||||
"types": ["cypress", "node"],
|
"types": ["cypress", "node", "cypress-grep"],
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"allowSyntheticDefaultImports": true,
|
"allowSyntheticDefaultImports": true,
|
||||||
|
@ -4,13 +4,17 @@ module.exports = defineConfig({
|
|||||||
projectId: 'et4snf',
|
projectId: 'et4snf',
|
||||||
|
|
||||||
e2e: {
|
e2e: {
|
||||||
|
setupNodeEvents(on, config) {
|
||||||
|
require('cypress-grep/src/plugin')(config);
|
||||||
|
return config;
|
||||||
|
},
|
||||||
baseUrl: 'http://localhost:4200',
|
baseUrl: 'http://localhost:4200',
|
||||||
fileServerFolder: '.',
|
fileServerFolder: '.',
|
||||||
fixturesFolder: false,
|
fixturesFolder: false,
|
||||||
specPattern: './src/integration/*.ts',
|
specPattern: './src/integration/*.ts',
|
||||||
excludeSpecPattern: '**/*.js',
|
excludeSpecPattern: '**/*.js',
|
||||||
modifyObstructiveCode: false,
|
modifyObstructiveCode: false,
|
||||||
supportFile: './src/support/index.ts',
|
supportFile: './src/support/index.js',
|
||||||
video: false,
|
video: false,
|
||||||
videoUploadOnPasses: false,
|
videoUploadOnPasses: false,
|
||||||
videosFolder:
|
videosFolder:
|
||||||
@ -21,4 +25,9 @@ module.exports = defineConfig({
|
|||||||
viewportWidth: 1440,
|
viewportWidth: 1440,
|
||||||
viewportHeight: 900,
|
viewportHeight: 900,
|
||||||
},
|
},
|
||||||
|
env: {
|
||||||
|
grepTags: '@regression @smoke @slow',
|
||||||
|
grepFilterSpecs: true,
|
||||||
|
grepOmitFiltered: true,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { getGreeting } from '../support/app.po';
|
import { getGreeting } from '../support/app.po';
|
||||||
|
|
||||||
describe('liquidity-provision-dashboard', () => {
|
describe('liquidity-provision-dashboard', { tags: '@smoke' }, () => {
|
||||||
beforeEach(() => cy.visit('/'));
|
beforeEach(() => cy.visit('/'));
|
||||||
|
|
||||||
it('should display welcome message', () => {
|
it('should display welcome message', () => {
|
||||||
|
@ -17,3 +17,5 @@ import '@vegaprotocol/cypress';
|
|||||||
import 'cypress-real-events/support';
|
import 'cypress-real-events/support';
|
||||||
// Import commands.js using ES2015 syntax:
|
// Import commands.js using ES2015 syntax:
|
||||||
import './commands';
|
import './commands';
|
||||||
|
import registerCypressGrep from 'cypress-grep';
|
||||||
|
registerCypressGrep();
|
@ -6,7 +6,7 @@
|
|||||||
"allowSyntheticDefaultImports": true,
|
"allowSyntheticDefaultImports": true,
|
||||||
"outDir": "../../dist/out-tsc",
|
"outDir": "../../dist/out-tsc",
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
"types": ["cypress", "node", "cypress-real-events"]
|
"types": ["cypress", "node", "cypress-real-events", "cypress-grep"]
|
||||||
},
|
},
|
||||||
"include": ["src/**/*.ts", "src/**/*.js"]
|
"include": ["src/**/*.ts", "src/**/*.js"]
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,10 @@ module.exports = defineConfig({
|
|||||||
projectId: 'et4snf',
|
projectId: 'et4snf',
|
||||||
|
|
||||||
e2e: {
|
e2e: {
|
||||||
|
setupNodeEvents(on, config) {
|
||||||
|
require('cypress-grep/src/plugin')(config);
|
||||||
|
return config;
|
||||||
|
},
|
||||||
baseUrl: 'http://localhost:3010',
|
baseUrl: 'http://localhost:3010',
|
||||||
fileServerFolder: '.',
|
fileServerFolder: '.',
|
||||||
fixturesFolder: false,
|
fixturesFolder: false,
|
||||||
@ -18,4 +22,9 @@ module.exports = defineConfig({
|
|||||||
viewportWidth: 1440,
|
viewportWidth: 1440,
|
||||||
viewportHeight: 900,
|
viewportHeight: 900,
|
||||||
},
|
},
|
||||||
|
env: {
|
||||||
|
grepTags: '@regression @smoke @slow',
|
||||||
|
grepFilterSpecs: true,
|
||||||
|
grepOmitFiltered: true,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
"allowSyntheticDefaultImports": true,
|
"allowSyntheticDefaultImports": true,
|
||||||
"outDir": "../../dist/out-tsc",
|
"outDir": "../../dist/out-tsc",
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
"types": ["cypress", "node"]
|
"types": ["cypress", "node", "cypress-grep"]
|
||||||
},
|
},
|
||||||
"include": ["src/**/*.ts", "src/**/*.js"]
|
"include": ["src/**/*.ts", "src/**/*.js"]
|
||||||
}
|
}
|
||||||
|
@ -14,4 +14,3 @@ NX_VEGA_WALLET_URL=http://localhost:1789/api/v1
|
|||||||
|
|
||||||
#Test configuration variables
|
#Test configuration variables
|
||||||
CYPRESS_FAIRGROUND=false
|
CYPRESS_FAIRGROUND=false
|
||||||
CYPRESS_INCLUDE_FLOWS=true
|
|
||||||
|
@ -1,21 +1,22 @@
|
|||||||
const { defineConfig } = require('cypress');
|
const { defineConfig } = require('cypress');
|
||||||
|
|
||||||
module.exports = defineConfig({
|
module.exports = defineConfig({
|
||||||
projectId: 'et4snf',
|
projectId: 'et4snf',
|
||||||
|
|
||||||
e2e: {
|
e2e: {
|
||||||
|
setupNodeEvents(on, config) {
|
||||||
|
require('cypress-grep/src/plugin')(config);
|
||||||
|
return config;
|
||||||
|
},
|
||||||
baseUrl: 'http://localhost:4210',
|
baseUrl: 'http://localhost:4210',
|
||||||
fileServerFolder: '.',
|
fileServerFolder: '.',
|
||||||
fixturesFolder: './src/fixtures',
|
fixturesFolder: './src/fixtures',
|
||||||
specPattern:
|
specPattern: [
|
||||||
process.env.CYPRESS_INCLUDE_FLOWS === 'true' ||
|
'./src/integration/view/**/*.cy.{js,jsx,ts,tsx}',
|
||||||
process.env.CYPRESS_INCLUDE_FLOWS === true
|
'./src/integration/flow/**/*.cy.{js,jsx,ts,tsx}',
|
||||||
? [
|
],
|
||||||
'./src/integration/view/**/*.cy.{js,jsx,ts,tsx}',
|
|
||||||
'./src/integration/flow/**/*.cy.{js,jsx,ts,tsx}',
|
|
||||||
]
|
|
||||||
: ['./src/integration/view/**/*.cy.{js,jsx,ts,tsx}'],
|
|
||||||
modifyObstructiveCode: false,
|
modifyObstructiveCode: false,
|
||||||
supportFile: './src/support/index.ts',
|
supportFile: './src/support/index.js',
|
||||||
video: false,
|
video: false,
|
||||||
videoUploadOnPasses: false,
|
videoUploadOnPasses: false,
|
||||||
videosFolder: '../../dist/cypress/apps/token-e2e/videos',
|
videosFolder: '../../dist/cypress/apps/token-e2e/videos',
|
||||||
@ -45,5 +46,8 @@ module.exports = defineConfig({
|
|||||||
epochTimeout: { timeout: 6000 },
|
epochTimeout: { timeout: 6000 },
|
||||||
blockConfirmations: 3,
|
blockConfirmations: 3,
|
||||||
CYPRESS_TEARDOWN_NETWORK_AFTER_FLOWS: true,
|
CYPRESS_TEARDOWN_NETWORK_AFTER_FLOWS: true,
|
||||||
|
grepTags: '@regression @smoke @slow',
|
||||||
|
grepFilterSpecs: true,
|
||||||
|
grepOmitFiltered: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -21,6 +21,7 @@ const vegaWallet = '[data-testid="vega-wallet"]';
|
|||||||
|
|
||||||
context(
|
context(
|
||||||
'Token association flow - with eth and vega wallets connected',
|
'Token association flow - with eth and vega wallets connected',
|
||||||
|
{ tags: '@slow' },
|
||||||
function () {
|
function () {
|
||||||
before('visit staking tab and connect vega wallet', function () {
|
before('visit staking tab and connect vega wallet', function () {
|
||||||
cy.vega_wallet_import();
|
cy.vega_wallet_import();
|
||||||
|
@ -6,67 +6,71 @@ const newProposalLink = '[data-testid="new-proposal-link"]';
|
|||||||
const governanceDocsUrl = 'https://vega.xyz/governance';
|
const governanceDocsUrl = 'https://vega.xyz/governance';
|
||||||
const connectToVegaWalletButton = '[data-testid="connect-to-vega-wallet-btn"]';
|
const connectToVegaWalletButton = '[data-testid="connect-to-vega-wallet-btn"]';
|
||||||
|
|
||||||
context('Governance Page - verify elements on page', function () {
|
context(
|
||||||
before('navigate to governance page', function () {
|
'Governance Page - verify elements on page',
|
||||||
cy.visit('/').navigate_to('governance');
|
{ tags: '@smoke' },
|
||||||
});
|
function () {
|
||||||
|
before('navigate to governance page', function () {
|
||||||
describe('with no network change proposals', function () {
|
cy.visit('/').navigate_to('governance');
|
||||||
it('should have governance tab highlighted', function () {
|
|
||||||
cy.verify_tab_highlighted('governance');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have GOVERNANCE header visible', function () {
|
describe('with no network change proposals', function () {
|
||||||
cy.verify_page_header('Governance');
|
it('should have governance tab highlighted', function () {
|
||||||
});
|
cy.verify_tab_highlighted('governance');
|
||||||
|
});
|
||||||
|
|
||||||
it('should be able to see a working link for - find out more about Vega governance', function () {
|
it('should have GOVERNANCE header visible', function () {
|
||||||
// 1004-VOTE-001
|
cy.verify_page_header('Governance');
|
||||||
cy.get(proposalDocumentationLink)
|
});
|
||||||
.should('be.visible')
|
|
||||||
.and('have.text', 'Find out more about Vega governance')
|
|
||||||
.and('have.attr', 'href')
|
|
||||||
.and('equal', governanceDocsUrl);
|
|
||||||
|
|
||||||
cy.request(governanceDocsUrl)
|
it('should be able to see a working link for - find out more about Vega governance', function () {
|
||||||
.its('body')
|
// 1004-VOTE-001
|
||||||
.then((body) => {
|
cy.get(proposalDocumentationLink)
|
||||||
if (!body.includes('Govern the network')) {
|
.should('be.visible')
|
||||||
assert.include(
|
.and('have.text', 'Find out more about Vega governance')
|
||||||
body,
|
.and('have.attr', 'href')
|
||||||
'Govern the network',
|
.and('equal', governanceDocsUrl);
|
||||||
`Checking that governance link destination includes 'Govern the network' text`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should be able to see button for - new proposal', function () {
|
cy.request(governanceDocsUrl)
|
||||||
// 1004-VOTE-002
|
.its('body')
|
||||||
cy.get(newProposalLink)
|
.then((body) => {
|
||||||
.should('be.visible')
|
if (!body.includes('Govern the network')) {
|
||||||
.and('have.text', 'New proposal')
|
assert.include(
|
||||||
.and('have.attr', 'href')
|
body,
|
||||||
.and('equal', '/governance/propose');
|
'Govern the network',
|
||||||
});
|
`Checking that governance link destination includes 'Govern the network' text`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
it('should be able to see that no proposals exist', function () {
|
it('should be able to see button for - new proposal', function () {
|
||||||
// 1004-VOTE-003
|
// 1004-VOTE-002
|
||||||
cy.get(noOpenProposals)
|
cy.get(newProposalLink)
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.and('have.text', 'There are no open or yet to enact proposals');
|
.and('have.text', 'New proposal')
|
||||||
cy.get(noClosedProposals)
|
.and('have.attr', 'href')
|
||||||
.should('be.visible')
|
.and('equal', '/governance/propose');
|
||||||
.and('have.text', 'There are no enacted or rejected proposals');
|
});
|
||||||
});
|
|
||||||
|
|
||||||
it('should be able to see a connect wallet button - if vega wallet disconnected and new proposal button selected', function () {
|
it('should be able to see that no proposals exist', function () {
|
||||||
cy.get(newProposalButton).should('be.visible').click();
|
// 1004-VOTE-003
|
||||||
cy.get(connectToVegaWalletButton)
|
cy.get(noOpenProposals)
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.and('have.text', 'Connect Vega wallet');
|
.and('have.text', 'There are no open or yet to enact proposals');
|
||||||
cy.navigate_to('governance');
|
cy.get(noClosedProposals)
|
||||||
cy.wait_for_spinner();
|
.should('be.visible')
|
||||||
|
.and('have.text', 'There are no enacted or rejected proposals');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should be able to see a connect wallet button - if vega wallet disconnected and new proposal button selected', function () {
|
||||||
|
cy.get(newProposalButton).should('be.visible').click();
|
||||||
|
cy.get(connectToVegaWalletButton)
|
||||||
|
.should('be.visible')
|
||||||
|
.and('have.text', 'Connect Vega wallet');
|
||||||
|
cy.navigate_to('governance');
|
||||||
|
cy.wait_for_spinner();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
});
|
);
|
||||||
|
@ -23,7 +23,7 @@ const governanceBtn = '[data-testid="governance-button-on-homepage"]';
|
|||||||
const vegaTokenAddress = Cypress.env('vegaTokenAddress');
|
const vegaTokenAddress = Cypress.env('vegaTokenAddress');
|
||||||
const vegaTokenContractAddress = Cypress.env('vegaTokenContractAddress');
|
const vegaTokenContractAddress = Cypress.env('vegaTokenContractAddress');
|
||||||
|
|
||||||
context('Home Page - verify elements on page', function () {
|
context('Home Page - verify elements on page', { tags: '@smoke' }, function () {
|
||||||
before('visit token home page', function () {
|
before('visit token home page', function () {
|
||||||
cy.visit('/');
|
cy.visit('/');
|
||||||
});
|
});
|
||||||
|
@ -1,33 +1,37 @@
|
|||||||
const connectToVegaBtn = '[data-testid="connect-to-vega-wallet-btn"]';
|
const connectToVegaBtn = '[data-testid="connect-to-vega-wallet-btn"]';
|
||||||
const warning = '[data-testid="callout"]';
|
const warning = '[data-testid="callout"]';
|
||||||
|
|
||||||
context('Rewards Page - verify elements on page', function () {
|
context(
|
||||||
before('navigate to rewards page', function () {
|
'Rewards Page - verify elements on page',
|
||||||
cy.visit('/').navigate_to('rewards');
|
{ tags: '@regression' },
|
||||||
});
|
function () {
|
||||||
|
before('navigate to rewards page', function () {
|
||||||
describe('with wallets disconnected', function () {
|
cy.visit('/').navigate_to('rewards');
|
||||||
it('should have REWARDS tab highlighted', function () {
|
|
||||||
cy.verify_tab_highlighted('rewards');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have rewards header visible', function () {
|
describe('with wallets disconnected', function () {
|
||||||
cy.verify_page_header('Rewards');
|
it('should have REWARDS tab highlighted', function () {
|
||||||
});
|
cy.verify_tab_highlighted('rewards');
|
||||||
|
});
|
||||||
|
|
||||||
it('should have epoch warning', function () {
|
it('should have rewards header visible', function () {
|
||||||
cy.get(warning)
|
cy.verify_page_header('Rewards');
|
||||||
.should('be.visible')
|
});
|
||||||
.and(
|
|
||||||
'have.text',
|
|
||||||
'Rewards are credited 5 minutes after the epoch ends.This delay is set by a network parameter'
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should have connect Vega wallet button', function () {
|
it('should have epoch warning', function () {
|
||||||
cy.get(connectToVegaBtn)
|
cy.get(warning)
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.and('have.text', 'Connect Vega wallet');
|
.and(
|
||||||
|
'have.text',
|
||||||
|
'Rewards are credited 5 minutes after the epoch ends.This delay is set by a network parameter'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should have connect Vega wallet button', function () {
|
||||||
|
cy.get(connectToVegaBtn)
|
||||||
|
.should('be.visible')
|
||||||
|
.and('have.text', 'Connect Vega wallet');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
});
|
);
|
||||||
|
@ -14,196 +14,202 @@ const stakeNumberRegex = /^\d*\.?\d*$/;
|
|||||||
const ownStake = '[data-testid="own-stake"]';
|
const ownStake = '[data-testid="own-stake"]';
|
||||||
const nominatedStake = '[data-testid="nominated-stake"]';
|
const nominatedStake = '[data-testid="nominated-stake"]';
|
||||||
|
|
||||||
context('Staking Page - verify elements on page', function () {
|
context(
|
||||||
before('navigate to staking page', function () {
|
'Staking Page - verify elements on page',
|
||||||
cy.visit('/').navigate_to('staking');
|
{ tags: '@smoke' },
|
||||||
});
|
function () {
|
||||||
|
before('navigate to staking page', function () {
|
||||||
describe('with wallets disconnected', function () {
|
cy.visit('/').navigate_to('staking');
|
||||||
describe('description section', function () {
|
|
||||||
it('should have staking tab highlighted', function () {
|
|
||||||
cy.verify_tab_highlighted('staking');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should have STAKING ON VEGA header visible', function () {
|
|
||||||
cy.verify_page_header('Staking');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should have Staking Guide link visible', function () {
|
|
||||||
// 1002-STKE-003
|
|
||||||
cy.get(guideLink)
|
|
||||||
.should('be.visible')
|
|
||||||
.and('have.text', 'Read more about staking on Vega')
|
|
||||||
.and(
|
|
||||||
'have.attr',
|
|
||||||
'href',
|
|
||||||
'https://docs.vega.xyz/docs/mainnet/concepts/vega-chain/#staking-on-vega'
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Should be able to see validator list from the staking page', function () {
|
describe('with wallets disconnected', function () {
|
||||||
// 1002-STKE-050
|
describe('description section', function () {
|
||||||
it('Should be able to see validator names', function () {
|
it('should have staking tab highlighted', function () {
|
||||||
cy.get('[col-id="validator"]')
|
cy.verify_tab_highlighted('staking');
|
||||||
.should('have.length.at.least', 1)
|
|
||||||
.each(($name) => {
|
|
||||||
cy.wrap($name).should('not.be.empty');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('Should be able to see validator status', function () {
|
|
||||||
cy.get('[col-id="status"]')
|
|
||||||
.should('have.length.at.least', 1)
|
|
||||||
.each(($status) => {
|
|
||||||
cy.wrap($status).should('not.be.empty');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('Should be able to see total stake for this epoch', function () {
|
|
||||||
cy.get('[col-id="totalStakeThisEpoch"]')
|
|
||||||
.should('have.length.at.least', 1)
|
|
||||||
.each(($totalStaked) => {
|
|
||||||
cy.wrap($totalStaked).should('not.be.empty');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('Should be able to see validator staked for this epoch', function () {
|
|
||||||
cy.get('[col-id="validatorStake"]')
|
|
||||||
.should('have.length.at.least', 1)
|
|
||||||
.each(($validatorStake) => {
|
|
||||||
cy.wrap($validatorStake).should('not.be.empty');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('Should be able to see validator staked for next epoch', function () {
|
|
||||||
cy.get('[col-id="pendingStake"]')
|
|
||||||
.should('have.length.at.least', 1)
|
|
||||||
.each(($pendingStake) => {
|
|
||||||
cy.wrap($pendingStake).should('not.be.empty');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// 1002-STKE-021
|
|
||||||
it('Should be able to see validator ranking score', function () {
|
|
||||||
cy.get('.ag-body-horizontal-scroll-viewport').scrollTo('right');
|
|
||||||
cy.get('[col-id="rankingScore"]')
|
|
||||||
.should('have.length.at.least', 1)
|
|
||||||
.each(($rankingScore) => {
|
|
||||||
cy.wrap($rankingScore).should('not.be.empty');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// 1002-STKE-022
|
|
||||||
it('Should be able to see validator stake score', function () {
|
|
||||||
cy.get('[col-id="stakeScore"]')
|
|
||||||
.should('have.length.at.least', 1)
|
|
||||||
.each(($stakeScore) => {
|
|
||||||
cy.wrap($stakeScore).should('not.be.empty');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// 1002-STKE-023
|
|
||||||
it('Should be able to see validator performance score', function () {
|
|
||||||
cy.get('[col-id="performanceScore"]')
|
|
||||||
.should('have.length.at.least', 1)
|
|
||||||
.each(($performanceScore) => {
|
|
||||||
cy.wrap($performanceScore).should('not.be.empty');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// 1002-STKE-024
|
|
||||||
it('Should be able to see validator voting power score', function () {
|
|
||||||
cy.get('[col-id="votingPower"]')
|
|
||||||
.should('have.length.at.least', 1)
|
|
||||||
.each(($votingPower) => {
|
|
||||||
cy.wrap($votingPower).should('not.be.empty');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// 1002-STKE-050
|
|
||||||
describe('Should be able to see static information about a validator', function () {
|
|
||||||
before('connect wallets and click on validator', function () {
|
|
||||||
cy.vega_wallet_import();
|
|
||||||
cy.vega_wallet_connect();
|
|
||||||
cy.click_on_validator_from_list(0);
|
|
||||||
});
|
|
||||||
|
|
||||||
// 1002-STKE-005
|
|
||||||
it('Should be able to see validator name', function () {
|
|
||||||
cy.get(validatorTitle).should('not.be.empty');
|
|
||||||
});
|
|
||||||
|
|
||||||
// 1002-STKE-007
|
|
||||||
it('Should be able to see validator id', function () {
|
|
||||||
cy.get(validatorId).should('not.be.empty');
|
|
||||||
});
|
|
||||||
|
|
||||||
// 1002-STKE-008
|
|
||||||
it('Should be able to see validator public key', function () {
|
|
||||||
cy.get(validatorPubKey).should('not.be.empty');
|
|
||||||
});
|
|
||||||
|
|
||||||
// 1002-STKE-010
|
|
||||||
it('Should be able to see Ethereum address', function () {
|
|
||||||
cy.get(ethAddressLink).should('not.be.empty').and('have.attr', 'href');
|
|
||||||
});
|
|
||||||
// TODO validators missing url for more information about them 1002-STKE-09
|
|
||||||
|
|
||||||
// 1002-STKE-012
|
|
||||||
it('Should be able to see total stake', function () {
|
|
||||||
cy.get(totalStake).invoke('text').should('match', stakeNumberRegex);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('Should be able to see pending stake', function () {
|
|
||||||
cy.get(pendingStake).invoke('text').should('match', stakeNumberRegex);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('Should be able to see staked by operator', function () {
|
|
||||||
cy.get(stakedByOperator).invoke('text').should('match', stakeNumberRegex);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('Should be able to see staked by delegates', function () {
|
|
||||||
cy.get(stakedByDelegates)
|
|
||||||
.invoke('text')
|
|
||||||
.should('match', stakeNumberRegex);
|
|
||||||
});
|
|
||||||
|
|
||||||
// 1002-STKE-051
|
|
||||||
it('Should be able to see stake share in percentage', function () {
|
|
||||||
cy.get(stakeShare)
|
|
||||||
.invoke('text')
|
|
||||||
.then(($stakePercentage) => {
|
|
||||||
if ($stakePercentage != '-') {
|
|
||||||
cy.wrap($stakePercentage).should(
|
|
||||||
'match',
|
|
||||||
/\b(?<!\.)(?!0+(?:\.0+)?%)(?:\d|[1-9]\d|100)(?:(?<!100)\.\d+)?%/
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
// 1002-STKE-013
|
it('should have STAKING ON VEGA header visible', function () {
|
||||||
it('Should be able to see own stake this epoch', function () {
|
cy.verify_page_header('Staking');
|
||||||
cy.get(ownStake).invoke('text').should('match', stakeNumberRegex);
|
});
|
||||||
});
|
|
||||||
|
|
||||||
// 1002-STKE-014
|
it('should have Staking Guide link visible', function () {
|
||||||
it('Should be able to see nominated stake this epoch', function () {
|
// 1002-STKE-003
|
||||||
cy.get(nominatedStake).invoke('text').should('match', stakeNumberRegex);
|
cy.get(guideLink)
|
||||||
});
|
.should('be.visible')
|
||||||
|
.and('have.text', 'Read more about staking on Vega')
|
||||||
|
.and(
|
||||||
|
'have.attr',
|
||||||
|
'href',
|
||||||
|
'https://docs.vega.xyz/docs/mainnet/concepts/vega-chain/#staking-on-vega'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// 1002-STKE-011
|
describe('Should be able to see validator list from the staking page', function () {
|
||||||
it('should be able to see epoch information', function () {
|
// 1002-STKE-050
|
||||||
const epochTitle = 'h3';
|
it('Should be able to see validator names', function () {
|
||||||
const nextEpochInfo = 'p';
|
cy.get('[col-id="validator"]')
|
||||||
|
.should('have.length.at.least', 1)
|
||||||
|
.each(($name) => {
|
||||||
|
cy.wrap($name).should('not.be.empty');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
cy.get(epochCountDown).within(() => {
|
it('Should be able to see validator status', function () {
|
||||||
cy.get(epochTitle).should('not.be.empty');
|
cy.get('[col-id="status"]')
|
||||||
cy.get(nextEpochInfo).should('contain.text', 'Next epoch');
|
.should('have.length.at.least', 1)
|
||||||
|
.each(($status) => {
|
||||||
|
cy.wrap($status).should('not.be.empty');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should be able to see total stake for this epoch', function () {
|
||||||
|
cy.get('[col-id="totalStakeThisEpoch"]')
|
||||||
|
.should('have.length.at.least', 1)
|
||||||
|
.each(($totalStaked) => {
|
||||||
|
cy.wrap($totalStaked).should('not.be.empty');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should be able to see validator staked for this epoch', function () {
|
||||||
|
cy.get('[col-id="validatorStake"]')
|
||||||
|
.should('have.length.at.least', 1)
|
||||||
|
.each(($validatorStake) => {
|
||||||
|
cy.wrap($validatorStake).should('not.be.empty');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should be able to see validator staked for next epoch', function () {
|
||||||
|
cy.get('[col-id="pendingStake"]')
|
||||||
|
.should('have.length.at.least', 1)
|
||||||
|
.each(($pendingStake) => {
|
||||||
|
cy.wrap($pendingStake).should('not.be.empty');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// 1002-STKE-021
|
||||||
|
it('Should be able to see validator ranking score', function () {
|
||||||
|
cy.get('.ag-body-horizontal-scroll-viewport').scrollTo('right');
|
||||||
|
cy.get('[col-id="rankingScore"]')
|
||||||
|
.should('have.length.at.least', 1)
|
||||||
|
.each(($rankingScore) => {
|
||||||
|
cy.wrap($rankingScore).should('not.be.empty');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// 1002-STKE-022
|
||||||
|
it('Should be able to see validator stake score', function () {
|
||||||
|
cy.get('[col-id="stakeScore"]')
|
||||||
|
.should('have.length.at.least', 1)
|
||||||
|
.each(($stakeScore) => {
|
||||||
|
cy.wrap($stakeScore).should('not.be.empty');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// 1002-STKE-023
|
||||||
|
it('Should be able to see validator performance score', function () {
|
||||||
|
cy.get('[col-id="performanceScore"]')
|
||||||
|
.should('have.length.at.least', 1)
|
||||||
|
.each(($performanceScore) => {
|
||||||
|
cy.wrap($performanceScore).should('not.be.empty');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// 1002-STKE-024
|
||||||
|
it('Should be able to see validator voting power score', function () {
|
||||||
|
cy.get('[col-id="votingPower"]')
|
||||||
|
.should('have.length.at.least', 1)
|
||||||
|
.each(($votingPower) => {
|
||||||
|
cy.wrap($votingPower).should('not.be.empty');
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
});
|
// 1002-STKE-050
|
||||||
|
describe('Should be able to see static information about a validator', function () {
|
||||||
|
before('connect wallets and click on validator', function () {
|
||||||
|
cy.vega_wallet_import();
|
||||||
|
cy.vega_wallet_connect();
|
||||||
|
cy.click_on_validator_from_list(0);
|
||||||
|
});
|
||||||
|
|
||||||
|
// 1002-STKE-005
|
||||||
|
it('Should be able to see validator name', function () {
|
||||||
|
cy.get(validatorTitle).should('not.be.empty');
|
||||||
|
});
|
||||||
|
|
||||||
|
// 1002-STKE-007
|
||||||
|
it('Should be able to see validator id', function () {
|
||||||
|
cy.get(validatorId).should('not.be.empty');
|
||||||
|
});
|
||||||
|
|
||||||
|
// 1002-STKE-008
|
||||||
|
it('Should be able to see validator public key', function () {
|
||||||
|
cy.get(validatorPubKey).should('not.be.empty');
|
||||||
|
});
|
||||||
|
|
||||||
|
// 1002-STKE-010
|
||||||
|
it('Should be able to see Ethereum address', function () {
|
||||||
|
cy.get(ethAddressLink).should('not.be.empty').and('have.attr', 'href');
|
||||||
|
});
|
||||||
|
// TODO validators missing url for more information about them 1002-STKE-09
|
||||||
|
|
||||||
|
// 1002-STKE-012
|
||||||
|
it('Should be able to see total stake', function () {
|
||||||
|
cy.get(totalStake).invoke('text').should('match', stakeNumberRegex);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should be able to see pending stake', function () {
|
||||||
|
cy.get(pendingStake).invoke('text').should('match', stakeNumberRegex);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should be able to see staked by operator', function () {
|
||||||
|
cy.get(stakedByOperator)
|
||||||
|
.invoke('text')
|
||||||
|
.should('match', stakeNumberRegex);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should be able to see staked by delegates', function () {
|
||||||
|
cy.get(stakedByDelegates)
|
||||||
|
.invoke('text')
|
||||||
|
.should('match', stakeNumberRegex);
|
||||||
|
});
|
||||||
|
|
||||||
|
// 1002-STKE-051
|
||||||
|
it('Should be able to see stake share in percentage', function () {
|
||||||
|
cy.get(stakeShare)
|
||||||
|
.invoke('text')
|
||||||
|
.then(($stakePercentage) => {
|
||||||
|
if ($stakePercentage != '-') {
|
||||||
|
cy.wrap($stakePercentage).should(
|
||||||
|
'match',
|
||||||
|
/\b(?<!\.)(?!0+(?:\.0+)?%)(?:\d|[1-9]\d|100)(?:(?<!100)\.\d+)?%/
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// 1002-STKE-013
|
||||||
|
it('Should be able to see own stake this epoch', function () {
|
||||||
|
cy.get(ownStake).invoke('text').should('match', stakeNumberRegex);
|
||||||
|
});
|
||||||
|
|
||||||
|
// 1002-STKE-014
|
||||||
|
it('Should be able to see nominated stake this epoch', function () {
|
||||||
|
cy.get(nominatedStake).invoke('text').should('match', stakeNumberRegex);
|
||||||
|
});
|
||||||
|
|
||||||
|
// 1002-STKE-011
|
||||||
|
it('should be able to see epoch information', function () {
|
||||||
|
const epochTitle = 'h3';
|
||||||
|
const nextEpochInfo = 'p';
|
||||||
|
|
||||||
|
cy.get(epochCountDown).within(() => {
|
||||||
|
cy.get(epochTitle).should('not.be.empty');
|
||||||
|
cy.get(nextEpochInfo).should('contain.text', 'Next epoch');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
@ -1,28 +1,32 @@
|
|||||||
const connectPrompt = '[data-testid="eth-connect-prompt"]';
|
const connectPrompt = '[data-testid="eth-connect-prompt"]';
|
||||||
const connectButton = '[data-testid="connect-to-eth-btn"]';
|
const connectButton = '[data-testid="connect-to-eth-btn"]';
|
||||||
|
|
||||||
context('Vesting Page - verify elements on page', function () {
|
context(
|
||||||
before('navigate to vesting page', function () {
|
'Vesting Page - verify elements on page',
|
||||||
cy.visit('/').navigate_to('vesting');
|
{ tags: '@smoke' },
|
||||||
});
|
function () {
|
||||||
|
before('navigate to vesting page', function () {
|
||||||
describe('with wallets disconnected', function () {
|
cy.visit('/').navigate_to('vesting');
|
||||||
it('should have vesting tab highlighted', function () {
|
|
||||||
cy.verify_tab_highlighted('vesting');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have VESTING header visible', function () {
|
describe('with wallets disconnected', function () {
|
||||||
cy.verify_page_header('Vesting');
|
it('should have vesting tab highlighted', function () {
|
||||||
});
|
cy.verify_tab_highlighted('vesting');
|
||||||
|
});
|
||||||
|
|
||||||
it('should have connect Eth wallet info', function () {
|
it('should have VESTING header visible', function () {
|
||||||
cy.get(connectPrompt).should('be.visible');
|
cy.verify_page_header('Vesting');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have connect Eth wallet button', function () {
|
it('should have connect Eth wallet info', function () {
|
||||||
cy.get(connectButton)
|
cy.get(connectPrompt).should('be.visible');
|
||||||
.should('be.visible')
|
});
|
||||||
.and('have.text', 'Connect Ethereum wallet');
|
|
||||||
|
it('should have connect Eth wallet button', function () {
|
||||||
|
cy.get(connectButton)
|
||||||
|
.should('be.visible')
|
||||||
|
.and('have.text', 'Connect Ethereum wallet');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
});
|
);
|
||||||
|
@ -17,242 +17,248 @@ const dialog = '[role="dialog"]';
|
|||||||
const dialogHeader = '[data-testid="dialog-title"]';
|
const dialogHeader = '[data-testid="dialog-title"]';
|
||||||
const dialogCloseBtn = '[data-testid="dialog-close"]';
|
const dialogCloseBtn = '[data-testid="dialog-close"]';
|
||||||
|
|
||||||
context('Ethereum Wallet - verify elements on widget', function () {
|
context(
|
||||||
before('visit token home page', function () {
|
'Ethereum Wallet - verify elements on widget',
|
||||||
cy.visit('/');
|
{ tags: '@smoke' },
|
||||||
});
|
function () {
|
||||||
|
before('visit token home page', function () {
|
||||||
describe('with wallets disconnected', function () {
|
cy.visit('/');
|
||||||
before('wait for widget to load', function () {
|
|
||||||
cy.get(walletContainer, { timeout: 10000 }).should('be.visible');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have ETHEREUM KEY header visible', function () {
|
describe('with wallets disconnected', function () {
|
||||||
cy.get(walletContainer).within(() => {
|
before('wait for widget to load', function () {
|
||||||
cy.get(walletHeader)
|
cy.get(walletContainer, { timeout: 10000 }).should('be.visible');
|
||||||
.should('be.visible')
|
|
||||||
.and('have.text', 'Ethereum key');
|
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
it('should have Connect Ethereum button visible', function () {
|
it('should have ETHEREUM KEY header visible', function () {
|
||||||
cy.get(walletContainer).within(() => {
|
cy.get(walletContainer).within(() => {
|
||||||
cy.get(connectToEthButton)
|
cy.get(walletHeader)
|
||||||
.should('be.visible')
|
|
||||||
.and('have.text', 'Connect Ethereum wallet to associate $VEGA');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('when Connect Ethereum clicked', function () {
|
|
||||||
// 1000-ASSO-0002
|
|
||||||
before('', function () {
|
|
||||||
cy.get(connectToEthButton).click();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should have Connect Ethereum header visible', function () {
|
|
||||||
cy.get(dialog).within(() => {
|
|
||||||
cy.get(dialogHeader)
|
|
||||||
.should('be.visible')
|
|
||||||
.and('have.text', 'Connect to your Ethereum wallet');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should have connector list visible', function () {
|
|
||||||
const connectList = [
|
|
||||||
'Unknown',
|
|
||||||
'MetaMask, Brave or other injected web wallet',
|
|
||||||
'WalletConnect',
|
|
||||||
];
|
|
||||||
cy.get(connectorList).within(() => {
|
|
||||||
cy.get('button').each(($btn, i) => {
|
|
||||||
cy.wrap($btn).should('be.visible').and('have.text', connectList[i]);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
after('close popup', function () {
|
|
||||||
cy.get(dialog)
|
|
||||||
.within(() => {
|
|
||||||
cy.get(dialogCloseBtn).click();
|
|
||||||
})
|
|
||||||
.should('not.exist');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('when Ethereum wallet connected', function () {
|
|
||||||
before('connect to Ethereum wallet', function () {
|
|
||||||
cy.ethereum_wallet_connect();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should have ETHEREUM KEY header visible', function () {
|
|
||||||
cy.get(walletContainer).within(() => {
|
|
||||||
cy.get(walletHeader)
|
|
||||||
.should('be.visible')
|
|
||||||
.and('have.text', 'Ethereum key');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should have account number visible', function () {
|
|
||||||
cy.get(walletContainer).within(() => {
|
|
||||||
cy.get(accountNo)
|
|
||||||
.should('be.visible')
|
|
||||||
.and('have.text', Cypress.env('ethWalletPublicKeyTruncated'));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should have Associate button visible', function () {
|
|
||||||
cy.get(walletContainer).within(() => {
|
|
||||||
cy.get(associate).should('be.visible').and('have.text', 'Associate');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should have Disassociate button visible', function () {
|
|
||||||
cy.get(walletContainer).within(() => {
|
|
||||||
cy.get(disassociate)
|
|
||||||
.should('be.visible')
|
|
||||||
.and('have.text', 'Disassociate');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should have Disconnect button visible', function () {
|
|
||||||
cy.get(walletContainer).within(() => {
|
|
||||||
cy.get(disconnect).should('be.visible').and('have.text', 'Disconnect');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('VEGA IN VESTING CONTRACT', function () {
|
|
||||||
// 1000-ASSO-0007
|
|
||||||
it('should have currency title visible', function () {
|
|
||||||
cy.get(vegaInVesting).within(() => {
|
|
||||||
cy.get(currencyTitle)
|
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.and('have.text', 'VEGAIn vesting contract');
|
.and('have.text', 'Ethereum key');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have currency value visible', function () {
|
it('should have Connect Ethereum button visible', function () {
|
||||||
cy.get(vegaInVesting).within(() => {
|
cy.get(walletContainer).within(() => {
|
||||||
cy.get(currencyValue)
|
cy.get(connectToEthButton)
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.invoke('text')
|
.and('have.text', 'Connect Ethereum wallet to associate $VEGA');
|
||||||
.should('match', /\d{0,3}(,\d{3})*\.\d{18}$/);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
it('should have progress bar visible', function () {
|
describe('when Connect Ethereum clicked', function () {
|
||||||
cy.get(vegaInVesting).within(() => {
|
// 1000-ASSO-0002
|
||||||
cy.get(progressBar).should('be.visible');
|
before('', function () {
|
||||||
});
|
cy.get(connectToEthButton).click();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have locked currency visible', function () {
|
it('should have Connect Ethereum header visible', function () {
|
||||||
cy.get(vegaInVesting).within(() => {
|
cy.get(dialog).within(() => {
|
||||||
cy.get(currencyLocked)
|
cy.get(dialogHeader)
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.invoke('text')
|
.and('have.text', 'Connect to your Ethereum wallet');
|
||||||
.should('match', /\d{0,3}(,\d{3})*\.\d{2}$/);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have unlocked currency visible', function () {
|
it('should have connector list visible', function () {
|
||||||
cy.get(vegaInVesting).within(() => {
|
const connectList = [
|
||||||
cy.get(currencyUnlocked)
|
'Unknown',
|
||||||
.should('be.visible')
|
'MetaMask, Brave or other injected web wallet',
|
||||||
.invoke('text')
|
'WalletConnect',
|
||||||
.should('match', /\d{0,3}(,\d{3})*\.\d{2}$/);
|
];
|
||||||
});
|
cy.get(connectorList).within(() => {
|
||||||
});
|
cy.get('button').each(($btn, i) => {
|
||||||
|
cy.wrap($btn).should('be.visible').and('have.text', connectList[i]);
|
||||||
it('should match total & locked/unlocked currency value', function () {
|
|
||||||
cy.get(vegaInVesting)
|
|
||||||
.within(() => {
|
|
||||||
cy.get(currencyValue)
|
|
||||||
.invoke('text')
|
|
||||||
.convert_token_value_to_number()
|
|
||||||
.as('value');
|
|
||||||
cy.get(currencyLocked)
|
|
||||||
.invoke('text')
|
|
||||||
.convert_token_value_to_number()
|
|
||||||
.as('locked');
|
|
||||||
cy.get(currencyUnlocked)
|
|
||||||
.invoke('text')
|
|
||||||
.convert_token_value_to_number()
|
|
||||||
.as('unlocked');
|
|
||||||
})
|
|
||||||
.then(function () {
|
|
||||||
expect(parseFloat(this.value).toFixed(1)).to.equal(
|
|
||||||
parseFloat(
|
|
||||||
Math.round((this.locked + this.unlocked) * 100) / 100
|
|
||||||
).toFixed(1)
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('VEGA IN WALLET', function () {
|
|
||||||
// 1000-ASSO-0007
|
|
||||||
it('should have currency title visible', function () {
|
|
||||||
cy.get(vegaInWallet).within(() => {
|
|
||||||
cy.get(currencyTitle)
|
|
||||||
.should('be.visible')
|
|
||||||
.and('have.text', 'VEGAIn Wallet');
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have currency value visible', function () {
|
after('close popup', function () {
|
||||||
cy.get(vegaInWallet).within(() => {
|
cy.get(dialog)
|
||||||
cy.get(currencyValue)
|
|
||||||
.should('be.visible')
|
|
||||||
.invoke('text')
|
|
||||||
.should('match', /\d{0,3}(,\d{3})*\.\d{18}$/);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should have progress bar visible', function () {
|
|
||||||
cy.get(vegaInWallet).within(() => {
|
|
||||||
cy.get(progressBar).should('be.visible');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should have locked currency visible', function () {
|
|
||||||
cy.get(vegaInWallet).within(() => {
|
|
||||||
cy.get(currencyLocked)
|
|
||||||
.should('be.visible')
|
|
||||||
.invoke('text')
|
|
||||||
.should('match', /\d{0,3}(,\d{3})*\.\d{2}$/);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should have unlocked currency visible', function () {
|
|
||||||
cy.get(vegaInWallet).within(() => {
|
|
||||||
cy.get(currencyUnlocked)
|
|
||||||
.should('be.visible')
|
|
||||||
.invoke('text')
|
|
||||||
.should('match', /\d{0,3}(,\d{3})*\.\d{2}$/);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should match total & locked/unlocked currency value', function () {
|
|
||||||
cy.get(vegaInWallet)
|
|
||||||
.within(() => {
|
.within(() => {
|
||||||
cy.get(currencyValue)
|
cy.get(dialogCloseBtn).click();
|
||||||
.invoke('text')
|
|
||||||
.convert_token_value_to_number()
|
|
||||||
.as('value');
|
|
||||||
cy.get(currencyLocked)
|
|
||||||
.invoke('text')
|
|
||||||
.convert_token_value_to_number()
|
|
||||||
.as('locked');
|
|
||||||
cy.get(currencyUnlocked)
|
|
||||||
.invoke('text')
|
|
||||||
.convert_token_value_to_number()
|
|
||||||
.as('unlocked');
|
|
||||||
})
|
})
|
||||||
.then(function () {
|
.should('not.exist');
|
||||||
expect(this.value).to.equal(this.locked + this.unlocked);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
});
|
describe('when Ethereum wallet connected', function () {
|
||||||
|
before('connect to Ethereum wallet', function () {
|
||||||
|
cy.ethereum_wallet_connect();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should have ETHEREUM KEY header visible', function () {
|
||||||
|
cy.get(walletContainer).within(() => {
|
||||||
|
cy.get(walletHeader)
|
||||||
|
.should('be.visible')
|
||||||
|
.and('have.text', 'Ethereum key');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should have account number visible', function () {
|
||||||
|
cy.get(walletContainer).within(() => {
|
||||||
|
cy.get(accountNo)
|
||||||
|
.should('be.visible')
|
||||||
|
.and('have.text', Cypress.env('ethWalletPublicKeyTruncated'));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should have Associate button visible', function () {
|
||||||
|
cy.get(walletContainer).within(() => {
|
||||||
|
cy.get(associate).should('be.visible').and('have.text', 'Associate');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should have Disassociate button visible', function () {
|
||||||
|
cy.get(walletContainer).within(() => {
|
||||||
|
cy.get(disassociate)
|
||||||
|
.should('be.visible')
|
||||||
|
.and('have.text', 'Disassociate');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should have Disconnect button visible', function () {
|
||||||
|
cy.get(walletContainer).within(() => {
|
||||||
|
cy.get(disconnect)
|
||||||
|
.should('be.visible')
|
||||||
|
.and('have.text', 'Disconnect');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('VEGA IN VESTING CONTRACT', function () {
|
||||||
|
// 1000-ASSO-0007
|
||||||
|
it('should have currency title visible', function () {
|
||||||
|
cy.get(vegaInVesting).within(() => {
|
||||||
|
cy.get(currencyTitle)
|
||||||
|
.should('be.visible')
|
||||||
|
.and('have.text', 'VEGAIn vesting contract');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should have currency value visible', function () {
|
||||||
|
cy.get(vegaInVesting).within(() => {
|
||||||
|
cy.get(currencyValue)
|
||||||
|
.should('be.visible')
|
||||||
|
.invoke('text')
|
||||||
|
.should('match', /\d{0,3}(,\d{3})*\.\d{18}$/);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should have progress bar visible', function () {
|
||||||
|
cy.get(vegaInVesting).within(() => {
|
||||||
|
cy.get(progressBar).should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should have locked currency visible', function () {
|
||||||
|
cy.get(vegaInVesting).within(() => {
|
||||||
|
cy.get(currencyLocked)
|
||||||
|
.should('be.visible')
|
||||||
|
.invoke('text')
|
||||||
|
.should('match', /\d{0,3}(,\d{3})*\.\d{2}$/);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should have unlocked currency visible', function () {
|
||||||
|
cy.get(vegaInVesting).within(() => {
|
||||||
|
cy.get(currencyUnlocked)
|
||||||
|
.should('be.visible')
|
||||||
|
.invoke('text')
|
||||||
|
.should('match', /\d{0,3}(,\d{3})*\.\d{2}$/);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should match total & locked/unlocked currency value', function () {
|
||||||
|
cy.get(vegaInVesting)
|
||||||
|
.within(() => {
|
||||||
|
cy.get(currencyValue)
|
||||||
|
.invoke('text')
|
||||||
|
.convert_token_value_to_number()
|
||||||
|
.as('value');
|
||||||
|
cy.get(currencyLocked)
|
||||||
|
.invoke('text')
|
||||||
|
.convert_token_value_to_number()
|
||||||
|
.as('locked');
|
||||||
|
cy.get(currencyUnlocked)
|
||||||
|
.invoke('text')
|
||||||
|
.convert_token_value_to_number()
|
||||||
|
.as('unlocked');
|
||||||
|
})
|
||||||
|
.then(function () {
|
||||||
|
expect(parseFloat(this.value).toFixed(1)).to.equal(
|
||||||
|
parseFloat(
|
||||||
|
Math.round((this.locked + this.unlocked) * 100) / 100
|
||||||
|
).toFixed(1)
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('VEGA IN WALLET', function () {
|
||||||
|
// 1000-ASSO-0007
|
||||||
|
it('should have currency title visible', function () {
|
||||||
|
cy.get(vegaInWallet).within(() => {
|
||||||
|
cy.get(currencyTitle)
|
||||||
|
.should('be.visible')
|
||||||
|
.and('have.text', 'VEGAIn Wallet');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should have currency value visible', function () {
|
||||||
|
cy.get(vegaInWallet).within(() => {
|
||||||
|
cy.get(currencyValue)
|
||||||
|
.should('be.visible')
|
||||||
|
.invoke('text')
|
||||||
|
.should('match', /\d{0,3}(,\d{3})*\.\d{18}$/);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should have progress bar visible', function () {
|
||||||
|
cy.get(vegaInWallet).within(() => {
|
||||||
|
cy.get(progressBar).should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should have locked currency visible', function () {
|
||||||
|
cy.get(vegaInWallet).within(() => {
|
||||||
|
cy.get(currencyLocked)
|
||||||
|
.should('be.visible')
|
||||||
|
.invoke('text')
|
||||||
|
.should('match', /\d{0,3}(,\d{3})*\.\d{2}$/);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should have unlocked currency visible', function () {
|
||||||
|
cy.get(vegaInWallet).within(() => {
|
||||||
|
cy.get(currencyUnlocked)
|
||||||
|
.should('be.visible')
|
||||||
|
.invoke('text')
|
||||||
|
.should('match', /\d{0,3}(,\d{3})*\.\d{2}$/);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should match total & locked/unlocked currency value', function () {
|
||||||
|
cy.get(vegaInWallet)
|
||||||
|
.within(() => {
|
||||||
|
cy.get(currencyValue)
|
||||||
|
.invoke('text')
|
||||||
|
.convert_token_value_to_number()
|
||||||
|
.as('value');
|
||||||
|
cy.get(currencyLocked)
|
||||||
|
.invoke('text')
|
||||||
|
.convert_token_value_to_number()
|
||||||
|
.as('locked');
|
||||||
|
cy.get(currencyUnlocked)
|
||||||
|
.invoke('text')
|
||||||
|
.convert_token_value_to_number()
|
||||||
|
.as('unlocked');
|
||||||
|
})
|
||||||
|
.then(function () {
|
||||||
|
expect(this.value).to.equal(this.locked + this.unlocked);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
@ -24,251 +24,263 @@ const dialogVegaKey = '[data-testid="vega-public-key-full"]';
|
|||||||
const dialogDisconnectBtn = '[data-testid="disconnect"]';
|
const dialogDisconnectBtn = '[data-testid="disconnect"]';
|
||||||
const copyPublicKeyBtn = '[data-testid="copy-vega-public-key"]';
|
const copyPublicKeyBtn = '[data-testid="copy-vega-public-key"]';
|
||||||
|
|
||||||
context('Vega Wallet - verify elements on widget', function () {
|
context(
|
||||||
before('visit token home page', function () {
|
'Vega Wallet - verify elements on widget',
|
||||||
cy.visit('/');
|
{ tags: '@smoke' },
|
||||||
});
|
function () {
|
||||||
|
before('visit token home page', function () {
|
||||||
describe('with wallets disconnected', function () {
|
cy.visit('/');
|
||||||
before('wait for widget to load', function () {
|
|
||||||
cy.get(walletContainer, { timeout: 10000 }).should('be.visible');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have VEGA WALLET header visible', function () {
|
describe('with wallets disconnected', function () {
|
||||||
cy.get(walletContainer).within(() => {
|
before('wait for widget to load', function () {
|
||||||
cy.get(walletHeader)
|
cy.get(walletContainer, { timeout: 10000 }).should('be.visible');
|
||||||
.should('be.visible')
|
});
|
||||||
.and('have.text', 'Vega Wallet');
|
|
||||||
|
it('should have VEGA WALLET header visible', function () {
|
||||||
|
cy.get(walletContainer).within(() => {
|
||||||
|
cy.get(walletHeader)
|
||||||
|
.should('be.visible')
|
||||||
|
.and('have.text', 'Vega Wallet');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should have Connect Vega button visible', function () {
|
||||||
|
cy.get(walletContainer).within(() => {
|
||||||
|
cy.get(connectButton)
|
||||||
|
.should('be.visible')
|
||||||
|
.and('have.text', 'Connect Vega wallet to use associated $VEGA');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should have Get a Vega wallet link visible', function () {
|
||||||
|
cy.get(walletContainer).within(() => {
|
||||||
|
cy.get(getVegaLink)
|
||||||
|
.should('be.visible')
|
||||||
|
.and('have.text', 'Get a Vega wallet')
|
||||||
|
.and('have.attr', 'href', 'https://vega.xyz/wallet');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have Connect Vega button visible', function () {
|
describe('when connect button clicked', function () {
|
||||||
cy.get(walletContainer).within(() => {
|
before('click connect vega wallet button', function () {
|
||||||
cy.get(connectButton)
|
cy.get(walletContainer).within(() => {
|
||||||
.should('be.visible')
|
cy.get(connectButton).click();
|
||||||
.and('have.text', 'Connect Vega wallet to use associated $VEGA');
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should have Connect Vega header visible', function () {
|
||||||
|
cy.get(dialog).within(() => {
|
||||||
|
cy.get(dialogHeader)
|
||||||
|
.should('be.visible')
|
||||||
|
.and('have.text', 'Connect to your Vega Wallet');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should have REST connector visible on list', function () {
|
||||||
|
cy.get(connectorsList).within(() => {
|
||||||
|
cy.get('button')
|
||||||
|
.should('be.visible')
|
||||||
|
.and('have.text', 'rest provider');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should have close button visible', function () {
|
||||||
|
cy.get(dialog).within(() => {
|
||||||
|
cy.get(dialogCloseBtn).should('be.visible');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have Get a Vega wallet link visible', function () {
|
describe('when rest connector form opened', function () {
|
||||||
cy.get(walletContainer).within(() => {
|
before('click rest provider link', function () {
|
||||||
cy.get(getVegaLink)
|
cy.get(connectorsList).within(() => {
|
||||||
.should('be.visible')
|
cy.get('button').click();
|
||||||
.and('have.text', 'Get a Vega wallet')
|
});
|
||||||
.and('have.attr', 'href', 'https://vega.xyz/wallet');
|
|
||||||
});
|
});
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('when connect button clicked', function () {
|
it('should have wallet field visible', function () {
|
||||||
before('click connect vega wallet button', function () {
|
cy.get(restConnectorForm).within(() => {
|
||||||
cy.get(walletContainer).within(() => {
|
cy.get(restWallet).should('be.visible');
|
||||||
cy.get(connectButton).click();
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should have password field visible', function () {
|
||||||
|
cy.get(restConnectorForm).within(() => {
|
||||||
|
cy.get(restPassphrase).should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should have connect button visible', function () {
|
||||||
|
cy.get(restConnectorForm).within(() => {
|
||||||
|
cy.get(restConnectBtn)
|
||||||
|
.should('be.visible')
|
||||||
|
.and('have.text', 'Connect');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should have Connect Vega header visible', function () {
|
||||||
|
cy.get(dialog).within(() => {
|
||||||
|
cy.get(dialogHeader)
|
||||||
|
.should('be.visible')
|
||||||
|
.and('have.text', 'Connect to your Vega Wallet');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should have close button visible', function () {
|
||||||
|
cy.get(dialog).within(() => {
|
||||||
|
cy.get(dialogCloseBtn).should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// after('close dialog', function () {
|
||||||
|
// cy.get(dialogCloseBtn).click().should('not.exist');
|
||||||
|
// }); - to be changed when dialog state is fixed - https://github.com/vegaprotocol/frontend-monorepo/issues/838
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('when vega wallet connected', function () {
|
||||||
|
before('connect vega wallet', function () {
|
||||||
|
cy.vega_wallet_import();
|
||||||
|
|
||||||
|
// cy.vega_wallet_connect(); - to be changed when dialog state is fixed - https://github.com/vegaprotocol/frontend-monorepo/issues/838
|
||||||
|
// then code below can be removed
|
||||||
|
cy.get(restConnectorForm).within(() => {
|
||||||
|
cy.get('#wallet').click().type(Cypress.env('vegaWalletName'));
|
||||||
|
cy.get('#passphrase')
|
||||||
|
.click()
|
||||||
|
.type(Cypress.env('vegaWalletPassphrase'));
|
||||||
|
cy.get('button').contains('Connect').click();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should have VEGA WALLET header visible', function () {
|
||||||
|
cy.get(walletContainer).within(() => {
|
||||||
|
cy.get(walletHeader)
|
||||||
|
.should('be.visible')
|
||||||
|
.and('have.text', 'Vega Wallet');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should have truncated account number visible', function () {
|
||||||
|
cy.get(walletContainer).within(() => {
|
||||||
|
cy.get(accountNo)
|
||||||
|
.should('be.visible')
|
||||||
|
.and('have.text', Cypress.env('vegaWalletPublicKeyShort'));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it.skip('should have wallet name visible', function () {
|
||||||
|
cy.get(walletContainer).within(() => {
|
||||||
|
cy.get(walletName)
|
||||||
|
.should('be.visible')
|
||||||
|
.and('have.text', `${Cypress.env('vegaWalletName')} key 1`);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should have Vega Associated currency title visible', function () {
|
||||||
|
cy.get(walletContainer).within(() => {
|
||||||
|
cy.get(currencyTitle)
|
||||||
|
.should('be.visible')
|
||||||
|
.and('have.text', `VEGAAssociated`);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should have Vega Associated currency value visible', function () {
|
||||||
|
cy.get(walletContainer).within(() => {
|
||||||
|
cy.get(currencyValue)
|
||||||
|
.should('be.visible')
|
||||||
|
.and('have.text', `0.000000000000000000`);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should have Unstaked value visible', function () {
|
||||||
|
cy.get(walletContainer).within(() => {
|
||||||
|
cy.get(vegaUnstaked)
|
||||||
|
.should('be.visible')
|
||||||
|
.and('have.text', `0.000000000000000000`);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should have Governance button visible', function () {
|
||||||
|
cy.get(walletContainer).within(() => {
|
||||||
|
cy.get(governanceBtn)
|
||||||
|
.should('be.visible')
|
||||||
|
.and('have.text', 'Governance');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should have Staking button visible', function () {
|
||||||
|
cy.get(walletContainer).within(() => {
|
||||||
|
cy.get(stakingBtn).should('be.visible').and('have.text', 'Staking');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should have Manage link visible', function () {
|
||||||
|
cy.get(walletContainer).within(() => {
|
||||||
|
cy.get(manageLink).should('be.visible').and('have.text', 'Manage');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have Connect Vega header visible', function () {
|
describe('when Manage dialog opened', function () {
|
||||||
cy.get(dialog).within(() => {
|
before('click Manage link', function () {
|
||||||
cy.get(dialogHeader)
|
cy.get(walletContainer).within(() => {
|
||||||
.should('be.visible')
|
cy.get(manageLink).click();
|
||||||
.and('have.text', 'Connect to your Vega Wallet');
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should have SELECT A VEGA KEY dialog title visible', function () {
|
||||||
|
cy.get(dialog).within(() => {
|
||||||
|
cy.get(dialogHeader)
|
||||||
|
.should('be.visible')
|
||||||
|
.and('have.text', 'SELECT A VEGA KEY');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it.skip('should have vega wallet public key and name visible', function () {
|
||||||
|
cy.get(dialog).within(() => {
|
||||||
|
cy.get(dialogVegaKey)
|
||||||
|
.should('be.visible')
|
||||||
|
.and(
|
||||||
|
'have.text',
|
||||||
|
`${Cypress.env('vegaWalletName')} key 1 ${truncateByChars(
|
||||||
|
Cypress.env('vegaWalletPublicKey')
|
||||||
|
)}`
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should have copy public key button visible', function () {
|
||||||
|
cy.get(dialog).within(() => {
|
||||||
|
cy.get(copyPublicKeyBtn)
|
||||||
|
.should('be.visible')
|
||||||
|
.and('have.text', 'Copy');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should have close button visible', function () {
|
||||||
|
cy.get(dialog).within(() => {
|
||||||
|
cy.get(dialogCloseBtn).should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should have vega Disconnect all keys button visible', function () {
|
||||||
|
cy.get(dialog).within(() => {
|
||||||
|
cy.get(dialogDisconnectBtn)
|
||||||
|
.should('be.visible')
|
||||||
|
.and('have.text', 'Disconnect all keys');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should be able to disconnect all keys', function () {
|
||||||
|
cy.get(dialog).within(() => {
|
||||||
|
cy.get(dialogDisconnectBtn).click();
|
||||||
|
});
|
||||||
|
cy.get(walletContainer).within(() => {
|
||||||
|
cy.get(connectButton).should('be.visible');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
}
|
||||||
it('should have REST connector visible on list', function () {
|
);
|
||||||
cy.get(connectorsList).within(() => {
|
|
||||||
cy.get('button').should('be.visible').and('have.text', 'rest provider');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should have close button visible', function () {
|
|
||||||
cy.get(dialog).within(() => {
|
|
||||||
cy.get(dialogCloseBtn).should('be.visible');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('when rest connector form opened', function () {
|
|
||||||
before('click rest provider link', function () {
|
|
||||||
cy.get(connectorsList).within(() => {
|
|
||||||
cy.get('button').click();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should have wallet field visible', function () {
|
|
||||||
cy.get(restConnectorForm).within(() => {
|
|
||||||
cy.get(restWallet).should('be.visible');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should have password field visible', function () {
|
|
||||||
cy.get(restConnectorForm).within(() => {
|
|
||||||
cy.get(restPassphrase).should('be.visible');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should have connect button visible', function () {
|
|
||||||
cy.get(restConnectorForm).within(() => {
|
|
||||||
cy.get(restConnectBtn).should('be.visible').and('have.text', 'Connect');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should have Connect Vega header visible', function () {
|
|
||||||
cy.get(dialog).within(() => {
|
|
||||||
cy.get(dialogHeader)
|
|
||||||
.should('be.visible')
|
|
||||||
.and('have.text', 'Connect to your Vega Wallet');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should have close button visible', function () {
|
|
||||||
cy.get(dialog).within(() => {
|
|
||||||
cy.get(dialogCloseBtn).should('be.visible');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// after('close dialog', function () {
|
|
||||||
// cy.get(dialogCloseBtn).click().should('not.exist');
|
|
||||||
// }); - to be changed when dialog state is fixed - https://github.com/vegaprotocol/frontend-monorepo/issues/838
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('when vega wallet connected', function () {
|
|
||||||
before('connect vega wallet', function () {
|
|
||||||
cy.vega_wallet_import();
|
|
||||||
|
|
||||||
// cy.vega_wallet_connect(); - to be changed when dialog state is fixed - https://github.com/vegaprotocol/frontend-monorepo/issues/838
|
|
||||||
// then code below can be removed
|
|
||||||
cy.get(restConnectorForm).within(() => {
|
|
||||||
cy.get('#wallet').click().type(Cypress.env('vegaWalletName'));
|
|
||||||
cy.get('#passphrase').click().type(Cypress.env('vegaWalletPassphrase'));
|
|
||||||
cy.get('button').contains('Connect').click();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should have VEGA WALLET header visible', function () {
|
|
||||||
cy.get(walletContainer).within(() => {
|
|
||||||
cy.get(walletHeader)
|
|
||||||
.should('be.visible')
|
|
||||||
.and('have.text', 'Vega Wallet');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should have truncated account number visible', function () {
|
|
||||||
cy.get(walletContainer).within(() => {
|
|
||||||
cy.get(accountNo)
|
|
||||||
.should('be.visible')
|
|
||||||
.and('have.text', Cypress.env('vegaWalletPublicKeyShort'));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it.skip('should have wallet name visible', function () {
|
|
||||||
cy.get(walletContainer).within(() => {
|
|
||||||
cy.get(walletName)
|
|
||||||
.should('be.visible')
|
|
||||||
.and('have.text', `${Cypress.env('vegaWalletName')} key 1`);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should have Vega Associated currency title visible', function () {
|
|
||||||
cy.get(walletContainer).within(() => {
|
|
||||||
cy.get(currencyTitle)
|
|
||||||
.should('be.visible')
|
|
||||||
.and('have.text', `VEGAAssociated`);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should have Vega Associated currency value visible', function () {
|
|
||||||
cy.get(walletContainer).within(() => {
|
|
||||||
cy.get(currencyValue)
|
|
||||||
.should('be.visible')
|
|
||||||
.and('have.text', `0.000000000000000000`);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should have Unstaked value visible', function () {
|
|
||||||
cy.get(walletContainer).within(() => {
|
|
||||||
cy.get(vegaUnstaked)
|
|
||||||
.should('be.visible')
|
|
||||||
.and('have.text', `0.000000000000000000`);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should have Governance button visible', function () {
|
|
||||||
cy.get(walletContainer).within(() => {
|
|
||||||
cy.get(governanceBtn)
|
|
||||||
.should('be.visible')
|
|
||||||
.and('have.text', 'Governance');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should have Staking button visible', function () {
|
|
||||||
cy.get(walletContainer).within(() => {
|
|
||||||
cy.get(stakingBtn).should('be.visible').and('have.text', 'Staking');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should have Manage link visible', function () {
|
|
||||||
cy.get(walletContainer).within(() => {
|
|
||||||
cy.get(manageLink).should('be.visible').and('have.text', 'Manage');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('when Manage dialog opened', function () {
|
|
||||||
before('click Manage link', function () {
|
|
||||||
cy.get(walletContainer).within(() => {
|
|
||||||
cy.get(manageLink).click();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should have SELECT A VEGA KEY dialog title visible', function () {
|
|
||||||
cy.get(dialog).within(() => {
|
|
||||||
cy.get(dialogHeader)
|
|
||||||
.should('be.visible')
|
|
||||||
.and('have.text', 'SELECT A VEGA KEY');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it.skip('should have vega wallet public key and name visible', function () {
|
|
||||||
cy.get(dialog).within(() => {
|
|
||||||
cy.get(dialogVegaKey)
|
|
||||||
.should('be.visible')
|
|
||||||
.and(
|
|
||||||
'have.text',
|
|
||||||
`${Cypress.env('vegaWalletName')} key 1 ${truncateByChars(
|
|
||||||
Cypress.env('vegaWalletPublicKey')
|
|
||||||
)}`
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should have copy public key button visible', function () {
|
|
||||||
cy.get(dialog).within(() => {
|
|
||||||
cy.get(copyPublicKeyBtn).should('be.visible').and('have.text', 'Copy');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should have close button visible', function () {
|
|
||||||
cy.get(dialog).within(() => {
|
|
||||||
cy.get(dialogCloseBtn).should('be.visible');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should have vega Disconnect all keys button visible', function () {
|
|
||||||
cy.get(dialog).within(() => {
|
|
||||||
cy.get(dialogDisconnectBtn)
|
|
||||||
.should('be.visible')
|
|
||||||
.and('have.text', 'Disconnect all keys');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should be able to disconnect all keys', function () {
|
|
||||||
cy.get(dialog).within(() => {
|
|
||||||
cy.get(dialogDisconnectBtn).click();
|
|
||||||
});
|
|
||||||
cy.get(walletContainer).within(() => {
|
|
||||||
cy.get(connectButton).should('be.visible');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
@ -1,23 +1,27 @@
|
|||||||
const connectToVegaBtn = '[data-testid="connect-to-vega-wallet-btn"]';
|
const connectToVegaBtn = '[data-testid="connect-to-vega-wallet-btn"]';
|
||||||
|
|
||||||
context('Withdraw Page - verify elements on page', function () {
|
context(
|
||||||
before('navigate to withdrawals page', function () {
|
'Withdraw Page - verify elements on page',
|
||||||
cy.visit('/').navigate_to('withdrawals');
|
{ tags: '@smoke' },
|
||||||
});
|
function () {
|
||||||
|
before('navigate to withdrawals page', function () {
|
||||||
describe('with wallets disconnected', function () {
|
cy.visit('/').navigate_to('withdrawals');
|
||||||
it('should have withdraw tab highlighted', function () {
|
|
||||||
cy.verify_tab_highlighted('withdrawals');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have WITHDRAW header visible', function () {
|
describe('with wallets disconnected', function () {
|
||||||
cy.verify_page_header('Withdrawals');
|
it('should have withdraw tab highlighted', function () {
|
||||||
});
|
cy.verify_tab_highlighted('withdrawals');
|
||||||
|
});
|
||||||
|
|
||||||
it('should have connect Vega wallet button', function () {
|
it('should have WITHDRAW header visible', function () {
|
||||||
cy.get(connectToVegaBtn)
|
cy.verify_page_header('Withdrawals');
|
||||||
.should('be.visible')
|
});
|
||||||
.and('have.text', 'Connect Vega wallet');
|
|
||||||
|
it('should have connect Vega wallet button', function () {
|
||||||
|
cy.get(connectToVegaBtn)
|
||||||
|
.should('be.visible')
|
||||||
|
.and('have.text', 'Connect Vega wallet');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
});
|
);
|
||||||
|
2
apps/token-e2e/src/support/index.d.ts
vendored
2
apps/token-e2e/src/support/index.d.ts
vendored
@ -1,2 +0,0 @@
|
|||||||
// type definitions for Cypress object "cy"
|
|
||||||
/// <reference types="cypress" />
|
|
@ -5,6 +5,8 @@ import './staking.functions.js';
|
|||||||
import './wallet-eth.functions.js';
|
import './wallet-eth.functions.js';
|
||||||
import './wallet-teardown.functions.js';
|
import './wallet-teardown.functions.js';
|
||||||
import './wallet-vega.functions.js';
|
import './wallet-vega.functions.js';
|
||||||
|
import registerCypressGrep from 'cypress-grep';
|
||||||
|
registerCypressGrep();
|
||||||
|
|
||||||
// Hide fetch/XHR requests - They create a lot of noise in command log
|
// Hide fetch/XHR requests - They create a lot of noise in command log
|
||||||
const app = window.top;
|
const app = window.top;
|
@ -6,7 +6,7 @@
|
|||||||
"allowSyntheticDefaultImports": true,
|
"allowSyntheticDefaultImports": true,
|
||||||
"outDir": "../../dist/out-tsc",
|
"outDir": "../../dist/out-tsc",
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
"types": ["cypress", "node"]
|
"types": ["cypress", "node", "cypress-grep"]
|
||||||
},
|
},
|
||||||
"include": ["src/**/*.ts", "src/**/*.js"]
|
"include": ["src/**/*.ts", "src/**/*.js"]
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ module.exports = defineConfig({
|
|||||||
fileServerFolder: '.',
|
fileServerFolder: '.',
|
||||||
fixturesFolder: false,
|
fixturesFolder: false,
|
||||||
specPattern: '**/*.cy.{js,jsx,ts,tsx}',
|
specPattern: '**/*.cy.{js,jsx,ts,tsx}',
|
||||||
supportFile: './src/support/index.ts',
|
supportFile: './src/support/index.js',
|
||||||
video: false,
|
video: false,
|
||||||
videosFolder: '../../dist/cypress/apps/trading-e2e/videos',
|
videosFolder: '../../dist/cypress/apps/trading-e2e/videos',
|
||||||
screenshotsFolder: '../../dist/cypress/apps/trading-e2e/screenshots',
|
screenshotsFolder: '../../dist/cypress/apps/trading-e2e/screenshots',
|
||||||
@ -15,11 +15,15 @@ module.exports = defineConfig({
|
|||||||
defaultCommandTimeout: 10000,
|
defaultCommandTimeout: 10000,
|
||||||
},
|
},
|
||||||
e2e: {
|
e2e: {
|
||||||
|
setupNodeEvents(on, config) {
|
||||||
|
require('cypress-grep/src/plugin')(config);
|
||||||
|
return config;
|
||||||
|
},
|
||||||
baseUrl: 'http://localhost:4200',
|
baseUrl: 'http://localhost:4200',
|
||||||
fileServerFolder: '.',
|
fileServerFolder: '.',
|
||||||
fixturesFolder: false,
|
fixturesFolder: false,
|
||||||
specPattern: '**/*.cy.{js,jsx,ts,tsx}',
|
specPattern: '**/*.cy.{js,jsx,ts,tsx}',
|
||||||
supportFile: './src/support/index.ts',
|
supportFile: './src/support/index.js',
|
||||||
video: false,
|
video: false,
|
||||||
videosFolder: '../../dist/cypress/apps/trading-e2e/videos',
|
videosFolder: '../../dist/cypress/apps/trading-e2e/videos',
|
||||||
videoUploadOnPasses: false,
|
videoUploadOnPasses: false,
|
||||||
@ -49,5 +53,8 @@ module.exports = defineConfig({
|
|||||||
TRADING_TEST_VEGA_WALLET_PASSPHRASE: '123',
|
TRADING_TEST_VEGA_WALLET_PASSPHRASE: '123',
|
||||||
ETH_WALLET_MNEMONIC:
|
ETH_WALLET_MNEMONIC:
|
||||||
'ugly gallery notice network true range brave clarify flat logic someone chunk',
|
'ugly gallery notice network true range brave clarify flat logic someone chunk',
|
||||||
|
grepTags: '@regression @smoke @slow',
|
||||||
|
grepFilterSpecs: true,
|
||||||
|
grepOmitFiltered: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -8,7 +8,7 @@ const toAddressField = 'input[name="to"]';
|
|||||||
const amountField = 'input[name="amount"]';
|
const amountField = 'input[name="amount"]';
|
||||||
const formFieldError = 'input-error-text';
|
const formFieldError = 'input-error-text';
|
||||||
|
|
||||||
describe('deposit form validation', () => {
|
describe('deposit form validation', { tags: '@smoke' }, () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.mockWeb3Provider();
|
cy.mockWeb3Provider();
|
||||||
cy.mockGQLSubscription();
|
cy.mockGQLSubscription();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { connectVegaWallet } from '../support/vega-wallet';
|
import { connectVegaWallet } from '../support/vega-wallet';
|
||||||
|
|
||||||
describe('vega wallet', () => {
|
describe('vega wallet', { tags: '@smoke' }, () => {
|
||||||
const connectVegaBtn = 'connect-vega-wallet';
|
const connectVegaBtn = 'connect-vega-wallet';
|
||||||
const manageVegaBtn = 'manage-vega-wallet';
|
const manageVegaBtn = 'manage-vega-wallet';
|
||||||
const form = 'rest-connector-form';
|
const form = 'rest-connector-form';
|
||||||
@ -61,7 +61,7 @@ describe('vega wallet', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('ethereum wallet', () => {
|
describe('ethereum wallet', { tags: '@smoke' }, () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.mockWeb3Provider();
|
cy.mockWeb3Provider();
|
||||||
// Using portfolio withdrawals tab is it requires Ethereum wallet connection
|
// Using portfolio withdrawals tab is it requires Ethereum wallet connection
|
||||||
|
@ -2,7 +2,7 @@ import { aliasQuery } from '@vegaprotocol/cypress';
|
|||||||
import { MarketState } from '@vegaprotocol/types';
|
import { MarketState } from '@vegaprotocol/types';
|
||||||
import { mockTradingPage } from '../support/trading';
|
import { mockTradingPage } from '../support/trading';
|
||||||
|
|
||||||
describe('home', () => {
|
describe('home', { tags: '@regression' }, () => {
|
||||||
const selectMarketOverlay = 'select-market-list';
|
const selectMarketOverlay = 'select-market-list';
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.mockGQL((req) => {
|
cy.mockGQL((req) => {
|
||||||
|
@ -7,7 +7,7 @@ const marketTitle = 'accordion-title';
|
|||||||
const link = 'link';
|
const link = 'link';
|
||||||
const externalLink = 'external-link';
|
const externalLink = 'external-link';
|
||||||
|
|
||||||
describe('market info is displayed', () => {
|
describe('market info is displayed', { tags: '@smoke' }, () => {
|
||||||
before(() => {
|
before(() => {
|
||||||
cy.mockGQL((req) => {
|
cy.mockGQL((req) => {
|
||||||
mockTradingPage(req, MarketState.STATE_ACTIVE);
|
mockTradingPage(req, MarketState.STATE_ACTIVE);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { MarketState } from '@vegaprotocol/types';
|
import { MarketState } from '@vegaprotocol/types';
|
||||||
import { mockTradingPage } from '../support/trading';
|
import { mockTradingPage } from '../support/trading';
|
||||||
|
|
||||||
describe('markets table', () => {
|
describe('markets table', { tags: '@regression' }, () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.mockGQL((req) => {
|
cy.mockGQL((req) => {
|
||||||
mockTradingPage(req, MarketState.STATE_ACTIVE);
|
mockTradingPage(req, MarketState.STATE_ACTIVE);
|
||||||
|
@ -10,7 +10,7 @@ beforeEach(() => {
|
|||||||
cy.visit('/markets/market-0');
|
cy.visit('/markets/market-0');
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('accounts', () => {
|
describe('accounts', { tags: '@smoke' }, () => {
|
||||||
it('renders accounts', () => {
|
it('renders accounts', () => {
|
||||||
const tradingAccountRowId = '[row-id="ACCOUNT_TYPE_GENERAL-asset-id-null"]';
|
const tradingAccountRowId = '[row-id="ACCOUNT_TYPE_GENERAL-asset-id-null"]';
|
||||||
cy.getByTestId('Collateral').click();
|
cy.getByTestId('Collateral').click();
|
||||||
|
@ -10,7 +10,7 @@ beforeEach(() => {
|
|||||||
cy.visit('/markets/market-0');
|
cy.visit('/markets/market-0');
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('collateral', () => {
|
describe('collateral', { tags: '@smoke' }, () => {
|
||||||
const collateralTab = 'Collateral';
|
const collateralTab = 'Collateral';
|
||||||
const assetSymbolColumn = "[col-id='asset.symbol']";
|
const assetSymbolColumn = "[col-id='asset.symbol']";
|
||||||
const assetTypeColumn = "[col-id='type']";
|
const assetTypeColumn = "[col-id='type']";
|
||||||
|
@ -27,7 +27,7 @@ const mockTx = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
describe('deal ticket orders', () => {
|
describe('deal ticket orders', { tags: '@regression' }, () => {
|
||||||
before(() => {
|
before(() => {
|
||||||
cy.mockGQL((req) => {
|
cy.mockGQL((req) => {
|
||||||
mockTradingPage(req, MarketState.STATE_ACTIVE);
|
mockTradingPage(req, MarketState.STATE_ACTIVE);
|
||||||
@ -158,7 +158,7 @@ describe('deal ticket orders', () => {
|
|||||||
it.skip('unsuccessful order due to no collateral');
|
it.skip('unsuccessful order due to no collateral');
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('deal ticket validation', () => {
|
describe('deal ticket validation', { tags: '@regression' }, () => {
|
||||||
before(() => {
|
before(() => {
|
||||||
cy.mockGQL((req) => {
|
cy.mockGQL((req) => {
|
||||||
mockTradingPage(req, MarketState.STATE_ACTIVE);
|
mockTradingPage(req, MarketState.STATE_ACTIVE);
|
||||||
|
@ -4,7 +4,7 @@ import { MarketState } from '@vegaprotocol/types';
|
|||||||
import { connectVegaWallet } from '../support/vega-wallet';
|
import { connectVegaWallet } from '../support/vega-wallet';
|
||||||
import { mockTradingPage } from '../support/trading';
|
import { mockTradingPage } from '../support/trading';
|
||||||
|
|
||||||
describe('fills', () => {
|
describe('fills', { tags: '@regression' }, () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.mockGQL((req) => {
|
cy.mockGQL((req) => {
|
||||||
mockTradingPage(req, MarketState.STATE_ACTIVE);
|
mockTradingPage(req, MarketState.STATE_ACTIVE);
|
||||||
|
@ -14,7 +14,7 @@ before(() => {
|
|||||||
connectVegaWallet();
|
connectVegaWallet();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('orders', () => {
|
describe('orders', { tags: '@smoke' }, () => {
|
||||||
const orderSymbol = 'market.tradableInstrument.instrument.code';
|
const orderSymbol = 'market.tradableInstrument.instrument.code';
|
||||||
const orderSize = 'size';
|
const orderSize = 'size';
|
||||||
const orderType = 'type';
|
const orderType = 'type';
|
||||||
|
@ -9,7 +9,7 @@ beforeEach(() => {
|
|||||||
cy.mockGQLSubscription();
|
cy.mockGQLSubscription();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('positions', () => {
|
describe('positions', { tags: '@smoke' }, () => {
|
||||||
it('renders positions on trading page', () => {
|
it('renders positions on trading page', () => {
|
||||||
cy.visit('/markets/market-0');
|
cy.visit('/markets/market-0');
|
||||||
cy.getByTestId('Positions').click();
|
cy.getByTestId('Positions').click();
|
||||||
|
@ -9,7 +9,7 @@ beforeEach(() => {
|
|||||||
cy.visit('/markets/market-0');
|
cy.visit('/markets/market-0');
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('trades', () => {
|
describe('trades', { tags: '@smoke' }, () => {
|
||||||
const colIdPrice = 'price';
|
const colIdPrice = 'price';
|
||||||
const colIdSize = 'size';
|
const colIdSize = 'size';
|
||||||
const colIdCreatedAt = 'createdAt';
|
const colIdCreatedAt = 'createdAt';
|
||||||
|
@ -6,7 +6,7 @@ import { generateWithdrawFormQuery } from '../support/mocks/generate-withdraw-pa
|
|||||||
import { generateWithdrawals } from '../support/mocks/generate-withdrawals';
|
import { generateWithdrawals } from '../support/mocks/generate-withdrawals';
|
||||||
import { connectVegaWallet } from '../support/vega-wallet';
|
import { connectVegaWallet } from '../support/vega-wallet';
|
||||||
|
|
||||||
describe('withdraw', () => {
|
describe('withdraw', { tags: '@smoke' }, () => {
|
||||||
const formFieldError = 'input-error-text';
|
const formFieldError = 'input-error-text';
|
||||||
const toAddressField = 'input[name="to"]';
|
const toAddressField = 'input[name="to"]';
|
||||||
const assetSelectField = 'select[name="asset"]';
|
const assetSelectField = 'select[name="asset"]';
|
||||||
|
4
apps/trading-e2e/src/support/index.js
Normal file
4
apps/trading-e2e/src/support/index.js
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
import '@vegaprotocol/cypress';
|
||||||
|
import 'cypress-real-events/support';
|
||||||
|
import registerCypressGrep from 'cypress-grep';
|
||||||
|
registerCypressGrep();
|
@ -1,2 +0,0 @@
|
|||||||
import '@vegaprotocol/cypress';
|
|
||||||
import 'cypress-real-events/support';
|
|
@ -5,7 +5,7 @@
|
|||||||
"sourceMap": false,
|
"sourceMap": false,
|
||||||
"outDir": "../../dist/out-tsc",
|
"outDir": "../../dist/out-tsc",
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
"types": ["cypress", "node", "cypress-real-events"],
|
"types": ["cypress", "node", "cypress-real-events", "cypress-grep"],
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"allowSyntheticDefaultImports": true,
|
"allowSyntheticDefaultImports": true,
|
||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
@ -139,7 +139,7 @@
|
|||||||
"babel-jest": "27.5.1",
|
"babel-jest": "27.5.1",
|
||||||
"babel-loader": "8.1.0",
|
"babel-loader": "8.1.0",
|
||||||
"cypress": "^10.2.0",
|
"cypress": "^10.2.0",
|
||||||
"cypress-cucumber-preprocessor": "^4.3.1",
|
"cypress-grep": "^3.0.3",
|
||||||
"cypress-real-events": "^1.7.1",
|
"cypress-real-events": "^1.7.1",
|
||||||
"dotenv": "^16.0.1",
|
"dotenv": "^16.0.1",
|
||||||
"eslint": "8.15.0",
|
"eslint": "8.15.0",
|
||||||
|
Loading…
Reference in New Issue
Block a user