update test specs to handle the new multisite setup on CI

This commit is contained in:
Felipe Knorr Kuhn
2021-08-17 15:53:57 -07:00
parent 7e4c51f47f
commit de5518d262
5 changed files with 652 additions and 634 deletions

View File

@@ -1,5 +1,8 @@
describe('Bisq', () => {
let baseModule;
beforeEach(() => {
baseModule = (Cypress.env('BASE_MODULE') && Cypress.env('BASE_MODULE') === 'bisq') ? '' : '/bisq';
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');
@@ -20,68 +23,66 @@ describe('Bisq', () => {
});
});
it('loads the dashboard', () => {
cy.visit('/bisq');
cy.waitForSkeletonGone();
});
if (Cypress.env("BASE_MODULE") === '' || Cypress.env("BASE_MODULE") !== 'liquid') {
it('loads the transactions screen', () => {
cy.visit('/bisq');
cy.waitForSkeletonGone();
cy.get('li:nth-of-type(2) > a').click().then(() => {
cy.get('.table > tr').should('have.length', 50);
it('loads the dashboard', () => {
cy.visit(`${baseModule}`);
cy.waitForSkeletonGone();
});
});
it('loads the blocks screen', () => {
cy.visit('/bisq');
cy.waitForSkeletonGone();
cy.get('li:nth-of-type(3) > a').click().then(() => {
cy.wait('@blocks');
cy.get('tbody tr').should('have.length', 10);
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);
});
});
});
it('loads the stats screen', () => {
cy.visit('/bisq');
cy.waitForSkeletonGone();
cy.get('li:nth-of-type(4) > a').click().then(() => {
cy.wait('@stats');
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);
});
});
});
it('loads the api screen', () => {
cy.visit('/bisq');
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');
it('loads the stats screen', () => {
cy.visit(`${baseModule}`);
cy.waitForSkeletonGone();
cy.get('li:nth-of-type(4) > a').click().then(() => {
cy.wait('@stats');
});
});
});
it('shows blocks pagination with 5 pages (desktop)', () => {
cy.viewport(760, 800);
cy.visit('/bisq');
cy.waitForSkeletonGone();
cy.get('li:nth-of-type(3) > a').click().then(() => {
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');
});
});
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('/bisq');
cy.waitForSkeletonGone();
cy.get('li:nth-of-type(3) > a').click().then(() => {
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");
}
});