[tests] testnet -> testnet4

This commit is contained in:
nymkappa 2024-05-18 20:52:45 +02:00
parent 0497c750be
commit cb95423178
No known key found for this signature in database
GPG Key ID: 92358FC85D9645DE
9 changed files with 28 additions and 27 deletions

View File

@ -257,7 +257,7 @@ jobs:
spec: | spec: |
cypress/e2e/mainnet/*.spec.ts cypress/e2e/mainnet/*.spec.ts
cypress/e2e/signet/*.spec.ts cypress/e2e/signet/*.spec.ts
cypress/e2e/testnet/*.spec.ts cypress/e2e/testnet4/*.spec.ts
- module: "liquid" - module: "liquid"
spec: | spec: |
cypress/e2e/liquid/liquid.spec.ts cypress/e2e/liquid/liquid.spec.ts

View File

@ -112,8 +112,8 @@ describe('Mainnet', () => {
it('check op_return coinbase tooltip', () => { it('check op_return coinbase tooltip', () => {
cy.visit('/block/00000000000000000003c5f542bed265319c6cf64238cf1f1bb9bca3ebf686d2'); cy.visit('/block/00000000000000000003c5f542bed265319c6cf64238cf1f1bb9bca3ebf686d2');
cy.waitForSkeletonGone(); cy.waitForSkeletonGone();
cy.get('div > a > .badge').first().trigger('onmouseover'); cy.get('tbody > :nth-child(2) > :nth-child(1) > a').first().trigger('onmouseover');
cy.get('div > a > .badge').first().trigger('mouseenter'); cy.get('tbody > :nth-child(2) > :nth-child(1) > a').first().trigger('mouseenter');
cy.get('.tooltip-inner').should('be.visible'); cy.get('.tooltip-inner').should('be.visible');
}); });
@ -339,7 +339,7 @@ describe('Mainnet', () => {
cy.visit('/'); cy.visit('/');
cy.waitForSkeletonGone(); cy.waitForSkeletonGone();
cy.changeNetwork('testnet'); cy.changeNetwork('testnet4');
cy.changeNetwork('signet'); cy.changeNetwork('signet');
cy.changeNetwork('mainnet'); cy.changeNetwork('mainnet');
}); });

View File

@ -2,7 +2,7 @@ import { emitMempoolInfo } from '../../support/websocket';
const baseModule = Cypress.env('BASE_MODULE'); const baseModule = Cypress.env('BASE_MODULE');
describe('Testnet', () => { describe('Testnet4', () => {
beforeEach(() => { beforeEach(() => {
cy.intercept('/api/block-height/*').as('block-height'); cy.intercept('/api/block-height/*').as('block-height');
cy.intercept('/api/block/*').as('block'); cy.intercept('/api/block/*').as('block');
@ -13,7 +13,7 @@ describe('Testnet', () => {
if (baseModule === 'mempool') { if (baseModule === 'mempool') {
it('loads the dashboard', () => { it('loads the dashboard', () => {
cy.visit('/testnet'); cy.visit('/testnet4');
cy.waitForSkeletonGone(); cy.waitForSkeletonGone();
}); });
@ -25,7 +25,7 @@ describe('Testnet', () => {
it.skip('loads the dashboard with the skeleton blocks', () => { it.skip('loads the dashboard with the skeleton blocks', () => {
cy.mockMempoolSocket(); cy.mockMempoolSocket();
cy.visit('/testnet'); cy.visit('/testnet4');
cy.get(':nth-child(1) > #bitcoin-block-0').should('be.visible'); cy.get(':nth-child(1) > #bitcoin-block-0').should('be.visible');
cy.get(':nth-child(2) > #bitcoin-block-0').should('be.visible'); cy.get(':nth-child(2) > #bitcoin-block-0').should('be.visible');
cy.get(':nth-child(3) > #bitcoin-block-0').should('be.visible'); cy.get(':nth-child(3) > #bitcoin-block-0').should('be.visible');
@ -45,7 +45,7 @@ describe('Testnet', () => {
}); });
it('loads the pools screen', () => { it('loads the pools screen', () => {
cy.visit('/testnet'); cy.visit('/testnet4');
cy.waitForSkeletonGone(); cy.waitForSkeletonGone();
cy.get('#btn-pools').click().then(() => { cy.get('#btn-pools').click().then(() => {
cy.wait(1000); cy.wait(1000);
@ -53,7 +53,7 @@ describe('Testnet', () => {
}); });
it('loads the graphs screen', () => { it('loads the graphs screen', () => {
cy.visit('/testnet'); cy.visit('/testnet4');
cy.waitForSkeletonGone(); cy.waitForSkeletonGone();
cy.get('#btn-graphs').click().then(() => { cy.get('#btn-graphs').click().then(() => {
cy.wait(1000); cy.wait(1000);
@ -63,7 +63,7 @@ describe('Testnet', () => {
describe('tv mode', () => { describe('tv mode', () => {
it('loads the tv screen - desktop', () => { it('loads the tv screen - desktop', () => {
cy.viewport('macbook-16'); cy.viewport('macbook-16');
cy.visit('/testnet/graphs'); cy.visit('/testnet4/graphs');
cy.waitForSkeletonGone(); cy.waitForSkeletonGone();
cy.get('#btn-tv').click().then(() => { cy.get('#btn-tv').click().then(() => {
cy.wait(1000); cy.wait(1000);
@ -73,7 +73,7 @@ describe('Testnet', () => {
}); });
it('loads the tv screen - mobile', () => { it('loads the tv screen - mobile', () => {
cy.visit('/testnet/graphs'); cy.visit('/testnet4/graphs');
cy.waitForSkeletonGone(); cy.waitForSkeletonGone();
cy.get('#btn-tv').click().then(() => { cy.get('#btn-tv').click().then(() => {
cy.viewport('iphone-6'); cy.viewport('iphone-6');
@ -85,7 +85,7 @@ describe('Testnet', () => {
it('loads the api screen', () => { it('loads the api screen', () => {
cy.visit('/testnet'); cy.visit('/testnet4');
cy.waitForSkeletonGone(); cy.waitForSkeletonGone();
cy.get('#btn-docs').click().then(() => { cy.get('#btn-docs').click().then(() => {
cy.wait(1000); cy.wait(1000);
@ -94,13 +94,13 @@ describe('Testnet', () => {
describe('blocks', () => { describe('blocks', () => {
it('shows empty blocks properly', () => { it('shows empty blocks properly', () => {
cy.visit('/testnet/block/0'); cy.visit('/testnet4/block/0');
cy.waitForSkeletonGone(); cy.waitForSkeletonGone();
cy.get('h2').invoke('text').should('equal', '1 transaction'); cy.get('h2').invoke('text').should('equal', '1 transaction');
}); });
it('expands and collapses the block details', () => { it('expands and collapses the block details', () => {
cy.visit('/testnet/block/0'); cy.visit('/testnet4/block/0');
cy.waitForSkeletonGone(); cy.waitForSkeletonGone();
cy.get('.btn.btn-outline-info').click().then(() => { cy.get('.btn.btn-outline-info').click().then(() => {
cy.get('#details').should('be.visible'); cy.get('#details').should('be.visible');
@ -112,15 +112,15 @@ describe('Testnet', () => {
}); });
it('shows blocks with no pagination', () => { it('shows blocks with no pagination', () => {
cy.visit('/testnet/block/000000000000002f8ce27716e74ecc7ad9f7b5101fed12d09e28bb721b9460ea'); cy.visit('/testnet4/block/000000000066e8b6cc78a93f8989587f5819624bae2eb1c05f535cadded19f99');
cy.waitForSkeletonGone(); cy.waitForSkeletonGone();
cy.get('h2').invoke('text').should('equal', '11 transactions'); cy.get('h2').invoke('text').should('equal', '18 transactions');
cy.get('ul.pagination').first().children().should('have.length', 5); cy.get('ul.pagination').first().children().should('have.length', 5);
}); });
it('supports pagination on the block screen', () => { it('supports pagination on the block screen', () => {
// 48 txs // 48 txs
cy.visit('/testnet/block/000000000000002ca3878ebd98b313a1c2d531f2e70a6575d232ca7564dea7a9'); cy.visit('/testnet4/block/000000000000006982d53f8273bdff21dafc380c292eabc669b5ab6d732311c3');
cy.waitForSkeletonGone(); cy.waitForSkeletonGone();
cy.get('.header-bg.box > a').invoke('text').then((text1) => { cy.get('.header-bg.box > a').invoke('text').then((text1) => {
cy.get('.active + li').first().click().then(() => { cy.get('.active + li').first().click().then(() => {

View File

@ -72,7 +72,7 @@ Cypress.Commands.add('mockMempoolSocket', () => {
mockWebSocket(); mockWebSocket();
}); });
Cypress.Commands.add('changeNetwork', (network: "testnet" | "signet" | "liquid" | "mainnet") => { Cypress.Commands.add('changeNetwork', (network: "testnet" | "testnet4" | "signet" | "liquid" | "mainnet") => {
cy.get('.dropdown-toggle').click().then(() => { cy.get('.dropdown-toggle').click().then(() => {
cy.get(`a.${network}`).click().then(() => { cy.get(`a.${network}`).click().then(() => {
cy.waitForPageIdle(); cy.waitForPageIdle();

View File

@ -5,6 +5,6 @@ declare namespace Cypress {
waitForSkeletonGone(): Chainable<any> waitForSkeletonGone(): Chainable<any>
waitForPageIdle(): Chainable<any> waitForPageIdle(): Chainable<any>
mockMempoolSocket(): Chainable<any> mockMempoolSocket(): Chainable<any>
changeNetwork(network: "testnet"|"signet"|"liquid"|"mainnet"): Chainable<any> changeNetwork(network: "testnet"|"testnet4"|"signet"|"liquid"|"mainnet"): Chainable<any>
} }
} }

View File

@ -1,5 +1,6 @@
{ {
"TESTNET_ENABLED": false, "TESTNET_ENABLED": false,
"TESTNET4_ENABLED": false,
"SIGNET_ENABLED": false, "SIGNET_ENABLED": false,
"LIQUID_ENABLED": false, "LIQUID_ENABLED": false,
"LIQUID_TESTNET_ENABLED": false, "LIQUID_TESTNET_ENABLED": false,

View File

@ -50,16 +50,16 @@
"dev:ssr": "npm run generate-config && ng run mempool:serve-ssr", "dev:ssr": "npm run generate-config && ng run mempool:serve-ssr",
"serve:ssr": "npm run generate-config && node server.run.js", "serve:ssr": "npm run generate-config && node server.run.js",
"build:ssr": "npm run build && ng run mempool:server:production && ./node_modules/typescript/bin/tsc server.run.ts", "build:ssr": "npm run build && ng run mempool:server:production && ./node_modules/typescript/bin/tsc server.run.ts",
"config:defaults:mempool": "node update-config.js TESTNET_ENABLED=true SIGNET_ENABLED=true LIQUID_ENABLED=true LIQUID_TESTNET_ENABLED=true ITEMS_PER_PAGE=25 BASE_MODULE=mempool BLOCK_WEIGHT_UNITS=4000000 && npm run generate-config", "config:defaults:mempool": "node update-config.js TESTNET_ENABLED=true TESTNET4_ENABLED=true SIGNET_ENABLED=true LIQUID_ENABLED=true LIQUID_TESTNET_ENABLED=true ITEMS_PER_PAGE=25 BASE_MODULE=mempool BLOCK_WEIGHT_UNITS=4000000 && npm run generate-config",
"config:defaults:liquid": "node update-config.js TESTNET_ENABLED=true SIGNET_ENABLED=true LIQUID_ENABLED=true LIQUID_TESTNET_ENABLED=true ITEMS_PER_PAGE=25 BASE_MODULE=liquid BLOCK_WEIGHT_UNITS=300000 && npm run generate-config", "config:defaults:liquid": "node update-config.js TESTNET_ENABLED=true TESTNET4_ENABLED=true SIGNET_ENABLED=true LIQUID_ENABLED=true LIQUID_TESTNET_ENABLED=true ITEMS_PER_PAGE=25 BASE_MODULE=liquid BLOCK_WEIGHT_UNITS=300000 && npm run generate-config",
"prerender": "npm run ng -- run mempool:prerender", "prerender": "npm run ng -- run mempool:prerender",
"cypress:open": "cypress open", "cypress:open": "cypress open",
"cypress:run": "cypress run", "cypress:run": "cypress run",
"cypress:run:record": "cypress run --record", "cypress:run:record": "cypress run --record",
"cypress:open:ci": "node update-config.js TESTNET_ENABLED=true SIGNET_ENABLED=true LIQUID_ENABLED=true ITEMS_PER_PAGE=25 && npm run generate-config && start-server-and-test serve:local-prod 4200 cypress:open", "cypress:open:ci": "node update-config.js TESTNET_ENABLED=true TESTNET4_ENABLED=true SIGNET_ENABLED=true LIQUID_ENABLED=true ITEMS_PER_PAGE=25 && npm run generate-config && start-server-and-test serve:local-prod 4200 cypress:open",
"cypress:run:ci": "node update-config.js TESTNET_ENABLED=true SIGNET_ENABLED=true LIQUID_ENABLED=true ITEMS_PER_PAGE=25 && npm run generate-config && start-server-and-test serve:local-prod 4200 cypress:run:record", "cypress:run:ci": "node update-config.js TESTNET_ENABLED=true TESTNET4_ENABLED=true SIGNET_ENABLED=true LIQUID_ENABLED=true ITEMS_PER_PAGE=25 && npm run generate-config && start-server-and-test serve:local-prod 4200 cypress:run:record",
"cypress:open:ci:staging": "node update-config.js TESTNET_ENABLED=true SIGNET_ENABLED=true LIQUID_ENABLED=true ITEMS_PER_PAGE=25 && npm run generate-config && start-server-and-test serve:local-staging 4200 cypress:open", "cypress:open:ci:staging": "node update-config.js TESTNET_ENABLED=true TESTNET4_ENABLED=true SIGNET_ENABLED=true LIQUID_ENABLED=true ITEMS_PER_PAGE=25 && npm run generate-config && start-server-and-test serve:local-staging 4200 cypress:open",
"cypress:run:ci:staging": "node update-config.js TESTNET_ENABLED=true SIGNET_ENABLED=true LIQUID_ENABLED=true ITEMS_PER_PAGE=25 && npm run generate-config && start-server-and-test serve:local-staging 4200 cypress:run:record" "cypress:run:ci:staging": "node update-config.js TESTNET_ENABLED=true TESTNET4_ENABLED=true SIGNET_ENABLED=true LIQUID_ENABLED=true ITEMS_PER_PAGE=25 && npm run generate-config && start-server-and-test serve:local-staging 4200 cypress:run:record"
}, },
"dependencies": { "dependencies": {
"@angular-devkit/build-angular": "^17.3.1", "@angular-devkit/build-angular": "^17.3.1",

View File

@ -24,7 +24,7 @@ PROXY_CONFIG = [
'/api/**', '!/api/v1/ws', '/api/**', '!/api/v1/ws',
'!/liquid', '!/liquid/**', '!/liquid/', '!/liquid', '!/liquid/**', '!/liquid/',
'!/liquidtestnet', '!/liquidtestnet/**', '!/liquidtestnet/', '!/liquidtestnet', '!/liquidtestnet/**', '!/liquidtestnet/',
'/testnet/api/**', '/signet/api/**' '/testnet/api/**', '/signet/api/**', '/testnet4/api/**'
], ],
target: "https://mempool.space", target: "https://mempool.space",
ws: true, ws: true,

View File

@ -70,7 +70,7 @@
<a ngbDropdownItem class="mainnet" [routerLink]="networkPaths['mainnet'] || '/'"><app-svg-images name="bitcoin" width="22" height="22" viewBox="0 0 65 65" style="width: 25px; height: 25px;" class="mainnet mr-1"></app-svg-images> Mainnet</a> <a ngbDropdownItem class="mainnet" [routerLink]="networkPaths['mainnet'] || '/'"><app-svg-images name="bitcoin" width="22" height="22" viewBox="0 0 65 65" style="width: 25px; height: 25px;" class="mainnet mr-1"></app-svg-images> Mainnet</a>
<a ngbDropdownItem *ngIf="env.SIGNET_ENABLED" class="signet" [class.active]="network.val === 'signet'" [routerLink]="networkPaths['signet'] || '/signet'"><app-svg-images name="signet" width="22" height="22" viewBox="0 0 65 65" style="width: 25px; height: 25px;" class="mainnet mr-1"></app-svg-images> Signet</a> <a ngbDropdownItem *ngIf="env.SIGNET_ENABLED" class="signet" [class.active]="network.val === 'signet'" [routerLink]="networkPaths['signet'] || '/signet'"><app-svg-images name="signet" width="22" height="22" viewBox="0 0 65 65" style="width: 25px; height: 25px;" class="mainnet mr-1"></app-svg-images> Signet</a>
<a ngbDropdownItem *ngIf="env.TESTNET_ENABLED" class="testnet" [class.active]="network.val === 'testnet'" [routerLink]="networkPaths['testnet'] || '/testnet'"><app-svg-images name="testnet" width="22" height="22" viewBox="0 0 65 65" style="width: 25px; height: 25px;" class="mainnet mr-1"></app-svg-images> Testnet3</a> <a ngbDropdownItem *ngIf="env.TESTNET_ENABLED" class="testnet" [class.active]="network.val === 'testnet'" [routerLink]="networkPaths['testnet'] || '/testnet'"><app-svg-images name="testnet" width="22" height="22" viewBox="0 0 65 65" style="width: 25px; height: 25px;" class="mainnet mr-1"></app-svg-images> Testnet3</a>
<a ngbDropdownItem *ngIf="env.TESTNET4_ENABLED" class="testnet" [class.active]="network.val === 'testnet4'" [routerLink]="networkPaths['testnet4'] || '/testnet4'"><app-svg-images name="testnet4" width="22" height="22" viewBox="0 0 65 65" style="width: 25px; height: 25px;" class="mainnet mr-1"></app-svg-images> Testnet4 <span class="badge badge-pill badge-warning beta-network" i18n="beta">beta</span></a> <a ngbDropdownItem *ngIf="env.TESTNET4_ENABLED" class="testnet4" [class.active]="network.val === 'testnet4'" [routerLink]="networkPaths['testnet4'] || '/testnet4'"><app-svg-images name="testnet4" width="22" height="22" viewBox="0 0 65 65" style="width: 25px; height: 25px;" class="mainnet mr-1"></app-svg-images> Testnet4 <span class="badge badge-pill badge-warning beta-network" i18n="beta">beta</span></a>
<h6 *ngIf="env.LIQUID_ENABLED" class="dropdown-header" i18n="master-page.layer2-networks-header">Layer 2 Networks</h6> <h6 *ngIf="env.LIQUID_ENABLED" class="dropdown-header" i18n="master-page.layer2-networks-header">Layer 2 Networks</h6>
<a [href]="env.LIQUID_WEBSITE_URL + urlLanguage + (networkPaths['liquid'] || '')" ngbDropdownItem *ngIf="env.LIQUID_ENABLED" class="liquid" [class.active]="network.val === 'liquid'"><app-svg-images name="liquid" width="22" height="22" viewBox="0 0 125 125" style="width: 25px; height: 25px;" class="mainnet mr-1"></app-svg-images> Liquid</a> <a [href]="env.LIQUID_WEBSITE_URL + urlLanguage + (networkPaths['liquid'] || '')" ngbDropdownItem *ngIf="env.LIQUID_ENABLED" class="liquid" [class.active]="network.val === 'liquid'"><app-svg-images name="liquid" width="22" height="22" viewBox="0 0 125 125" style="width: 25px; height: 25px;" class="mainnet mr-1"></app-svg-images> Liquid</a>
<a [href]="env.LIQUID_WEBSITE_URL + urlLanguage + (networkPaths['liquidtestnet'] || '/testnet')" ngbDropdownItem *ngIf="env.LIQUID_TESTNET_ENABLED" class="liquidtestnet" [class.active]="network.val === 'liquid'"><app-svg-images name="liquidtestnet" width="22" height="22" viewBox="0 0 125 125" style="width: 25px; height: 25px;" class="mainnet mr-1"></app-svg-images> Liquid Testnet</a> <a [href]="env.LIQUID_WEBSITE_URL + urlLanguage + (networkPaths['liquidtestnet'] || '/testnet')" ngbDropdownItem *ngIf="env.LIQUID_TESTNET_ENABLED" class="liquidtestnet" [class.active]="network.val === 'liquid'"><app-svg-images name="liquidtestnet" width="22" height="22" viewBox="0 0 125 125" style="width: 25px; height: 25px;" class="mainnet mr-1"></app-svg-images> Liquid Testnet</a>