mempool/frontend/cypress/integration/bisq/bisq.spec.ts

89 lines
3.3 KiB
TypeScript
Raw Normal View History

describe('Bisq', () => {
let baseModule;
beforeEach(() => {
baseModule = (Cypress.env('BASE_MODULE') && Cypress.env('BASE_MODULE') === 'bisq') ? '' : '/bisq';
2021-06-07 21:48:27 +02:00
cy.intercept('/sockjs-node/info*').as('socket');
cy.intercept('/bisq/api/markets/hloc?market=btc_usd&interval=day').as('hloc');
cy.intercept('/bisq/api/markets/ticker').as('ticker');
cy.intercept('/bisq/api/markets/markets').as('markets');
cy.intercept('/bisq/api/markets/volumes/7d').as('7d');
cy.intercept('/bisq/api/markets/trades?market=all').as('trades');
cy.intercept('/bisq/api/txs/*/*').as('txs');
cy.intercept('/bisq/api/blocks/*/*').as('blocks');
cy.intercept('/bisq/api/stats').as('stats');
Updates to the e2e suite (#659) * initial version of the update config script * fix duplicated content * update cypress ci settings * add workflow to run e2e tests when pushing * record cypress results to the dashboard * pull the cypress record key and project id from the secrets * add start-server-and-test to replace concurrently * replace concurrently with start-server-and-test * remove concurrently * add new cypress target to record * update cypress to 7.7.0 * add tests for signet * add tests for testnet * run tests on chrome and firefox * update test matrix: add edge and run firefox on container * fix copypasta * update docker image for firefox * fix task name again * fix edge tests task name * improve bisq tests * update workflow config * enable cypress debug logs * add a manual trigger for the e2e tests * add config:defaults target * use more of the GHA options * fix config command * add cypress-fail-on-console-error * upgrade cypress to v8.0.0 * add helper to wait for the loader skeleton to be gone * use skeleton waiter on the tests * remove manual test trigger * fix tv test when only one mempool block is available * add waiter for pagination * add extra steps to debug firefox launch issue * remove whoami step * Revert "upgrade cypress to v8.0.0" This reverts commit cb3ff7d906c2a2219d7e2b2c16a92c311e3f6817. * remove userinfo debug step * enable test retries in run mode * update proxy config to reduce ECONNRESET errors * add mock-socket dev dependency * add helpers to mock websockets and detect page idleness * stabilize mainnet tests * fix tv mode test on Liquid * add basic tests for the mainnet status page * cleanup mainnet tests * update bisq tests * update signet tests * update testnet tests * add initial support for parameterized websocket mocks * move testing dependencies to optionalDependencies * comment out mempool size check until the live updates are fixed * comment out tx regex test * update fixture for the new difficulty adjustment component * fix the assertions on the status page
2021-07-25 20:03:47 +02:00
Cypress.Commands.add('waitForDashboard', () => {
cy.wait('@socket');
cy.wait('@hloc');
cy.wait('@ticker');
cy.wait('@markets');
cy.wait('@7d');
cy.wait('@trades');
});
2021-06-07 21:48:27 +02:00
});
if (Cypress.env("BASE_MODULE") === '' || Cypress.env("BASE_MODULE") !== 'liquid') {
it('loads the dashboard', () => {
cy.visit(`${baseModule}`);
cy.waitForSkeletonGone();
2021-06-07 21:48:27 +02:00
});
Updates to the e2e suite (#659) * initial version of the update config script * fix duplicated content * update cypress ci settings * add workflow to run e2e tests when pushing * record cypress results to the dashboard * pull the cypress record key and project id from the secrets * add start-server-and-test to replace concurrently * replace concurrently with start-server-and-test * remove concurrently * add new cypress target to record * update cypress to 7.7.0 * add tests for signet * add tests for testnet * run tests on chrome and firefox * update test matrix: add edge and run firefox on container * fix copypasta * update docker image for firefox * fix task name again * fix edge tests task name * improve bisq tests * update workflow config * enable cypress debug logs * add a manual trigger for the e2e tests * add config:defaults target * use more of the GHA options * fix config command * add cypress-fail-on-console-error * upgrade cypress to v8.0.0 * add helper to wait for the loader skeleton to be gone * use skeleton waiter on the tests * remove manual test trigger * fix tv test when only one mempool block is available * add waiter for pagination * add extra steps to debug firefox launch issue * remove whoami step * Revert "upgrade cypress to v8.0.0" This reverts commit cb3ff7d906c2a2219d7e2b2c16a92c311e3f6817. * remove userinfo debug step * enable test retries in run mode * update proxy config to reduce ECONNRESET errors * add mock-socket dev dependency * add helpers to mock websockets and detect page idleness * stabilize mainnet tests * fix tv mode test on Liquid * add basic tests for the mainnet status page * cleanup mainnet tests * update bisq tests * update signet tests * update testnet tests * add initial support for parameterized websocket mocks * move testing dependencies to optionalDependencies * comment out mempool size check until the live updates are fixed * comment out tx regex test * update fixture for the new difficulty adjustment component * fix the assertions on the status page
2021-07-25 20:03:47 +02:00
it('loads the transactions screen', () => {
cy.visit(`${baseModule}`);
cy.waitForSkeletonGone();
cy.get('li:nth-of-type(2) > a').click().then(() => {
cy.get('.table > tr').should('have.length', 50);
});
2021-06-07 21:48:27 +02:00
});
Updates to the e2e suite (#659) * initial version of the update config script * fix duplicated content * update cypress ci settings * add workflow to run e2e tests when pushing * record cypress results to the dashboard * pull the cypress record key and project id from the secrets * add start-server-and-test to replace concurrently * replace concurrently with start-server-and-test * remove concurrently * add new cypress target to record * update cypress to 7.7.0 * add tests for signet * add tests for testnet * run tests on chrome and firefox * update test matrix: add edge and run firefox on container * fix copypasta * update docker image for firefox * fix task name again * fix edge tests task name * improve bisq tests * update workflow config * enable cypress debug logs * add a manual trigger for the e2e tests * add config:defaults target * use more of the GHA options * fix config command * add cypress-fail-on-console-error * upgrade cypress to v8.0.0 * add helper to wait for the loader skeleton to be gone * use skeleton waiter on the tests * remove manual test trigger * fix tv test when only one mempool block is available * add waiter for pagination * add extra steps to debug firefox launch issue * remove whoami step * Revert "upgrade cypress to v8.0.0" This reverts commit cb3ff7d906c2a2219d7e2b2c16a92c311e3f6817. * remove userinfo debug step * enable test retries in run mode * update proxy config to reduce ECONNRESET errors * add mock-socket dev dependency * add helpers to mock websockets and detect page idleness * stabilize mainnet tests * fix tv mode test on Liquid * add basic tests for the mainnet status page * cleanup mainnet tests * update bisq tests * update signet tests * update testnet tests * add initial support for parameterized websocket mocks * move testing dependencies to optionalDependencies * comment out mempool size check until the live updates are fixed * comment out tx regex test * update fixture for the new difficulty adjustment component * fix the assertions on the status page
2021-07-25 20:03:47 +02:00
it('loads the blocks screen', () => {
cy.visit(`${baseModule}`);
cy.waitForSkeletonGone();
cy.get('li:nth-of-type(3) > a').click().then(() => {
cy.wait('@blocks');
cy.get('tbody tr').should('have.length', 10);
});
2021-06-07 21:48:27 +02:00
});
it('loads the stats screen', () => {
cy.visit(`${baseModule}`);
cy.waitForSkeletonGone();
cy.get('li:nth-of-type(4) > a').click().then(() => {
cy.wait('@stats');
});
});
it('loads the api screen', () => {
cy.visit(`${baseModule}`);
cy.waitForSkeletonGone();
cy.get('li:nth-of-type(5) > a').click().then(() => {
cy.get('.card').should('have.length.at.least', 1);
cy.get('.card').first().click();
cy.get('.card-body');
});
2021-06-07 21:48:27 +02:00
});
it('shows blocks pagination with 5 pages (desktop)', () => {
cy.viewport(760, 800);
cy.visit(`${baseModule}/blocks`);
cy.waitForSkeletonGone();
cy.get('tbody tr').should('have.length', 10);
// 5 pages + 4 buttons = 9 buttons
cy.get('.pagination-container ul.pagination').first().children().should('have.length', 9);
});
it('shows blocks pagination with 3 pages (mobile)', () => {
cy.viewport(669, 800);
cy.visit(`${baseModule}/blocks`);
cy.waitForSkeletonGone();
cy.get('tbody tr').should('have.length', 10);
// 3 pages + 4 buttons = 7 buttons
cy.get('.pagination-container ul.pagination').first().children().should('have.length', 7);
});
} else {
it.skip("Tests cannot be run on the selected BASE_MODULE");
}
2021-06-07 21:48:27 +02:00
});