Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: update test infrastructure #89

Merged
merged 10 commits into from
May 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dashcore-node
public
Gruntfile.js
node_modules
2 changes: 1 addition & 1 deletion .github/workflows/test_and_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:

- uses: actions/setup-node@v2
with:
node-version: '16'
node-version: '20'

- name: Enable NPM cache
uses: actions/cache@v2
Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16-alpine
FROM node:20-alpine

RUN apk add --update --no-cache git \
libzmq \
Expand All @@ -25,7 +25,7 @@ ARG MAJOR_VERSION
RUN bin/dashcore-node install @dashevo/insight-api@${MAJOR_VERSION}
RUN bin/dashcore-node install @dashevo/insight-ui@${VERSION}

FROM node:16-alpine
FROM node:20-alpine

LABEL maintainer="Dash Developers <dev@dash.org>"
LABEL description="Dockerised Insight-Dash"
Expand Down
42 changes: 22 additions & 20 deletions lib/test/pages/BlockPage.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
function BlockPage() {
const blockId = element(by.xpath('//*[contains(text(), "Block #")]'));
const blockHash = element(by.css('.txid.text-muted.ng-binding'));

const numberOfTrxs = element(by.xpath('//table//tr[1]//td[2]'));
const height = element(by.xpath('//table//tr[2]//td[2]'));
const blockReward = element(by.xpath('//table//tr[3]//td[2]'));
const timestamp = element(by.xpath('//table//tr[4]//td[2]'));
const minedBy = element(by.xpath('//table//tr[5]//td[2]'));
const merkleRoot = element(by.xpath('//table//tr[6]//td[2]//span[2]'));
const previousBlock = element(by.xpath('//table//tr[7]//td[2]'));
const difficulty = element(by.xpath("//div[@class='col-md-6'][2]/table//tr[1]/td[2]"));
const bits = element(by.xpath("//div[@class='col-md-6'][2]/table//tr[2]/td[2]"));
const size = element(by.xpath("//div[@class='col-md-6'][2]/table//tr[3]/td[2]"));
const version = element(by.xpath("//div[@class='col-md-6'][2]/table//tr[4]/td[2]"));
const nonce = element(by.xpath("//div[@class='col-md-6'][2]/table//tr[5]/td[2]"));
const nextBlock = element(by.xpath("//div[@class='col-md-6'][2]/table//tr[6]/td[2]"));

const trxHash = element(by.xpath("//a[contains(@href,'tx/')]"));
const { By } = require('selenium-webdriver');

function BlockPage(driver) {
const blockId = driver.findElement(By.xpath('//*[contains(text(), "Block #")]'));
const blockHash = driver.findElement(By.css('.txid.text-muted.ng-binding'));

const numberOfTrxs = driver.findElement(By.xpath('//table//tr[1]//td[2]'));
const height = driver.findElement(By.xpath('//table//tr[2]//td[2]'));
const blockReward = driver.findElement(By.xpath('//table//tr[3]//td[2]'));
const timestamp = driver.findElement(By.xpath('//table//tr[4]//td[2]'));
const minedBy = driver.findElement(By.xpath('//table//tr[5]//td[2]'));
const merkleRoot = driver.findElement(By.xpath('//table//tr[6]//td[2]//span[2]'));
const previousBlock = driver.findElement(By.xpath('//table//tr[7]//td[2]'));
const difficulty = driver.findElement(By.xpath("//div[@class='col-md-6'][2]/table//tr[1]/td[2]"));
const bits = driver.findElement(By.xpath("//div[@class='col-md-6'][2]/table//tr[2]/td[2]"));
const size = driver.findElement(By.xpath("//div[@class='col-md-6'][2]/table//tr[3]/td[2]"));
const version = driver.findElement(By.xpath("//div[@class='col-md-6'][2]/table//tr[4]/td[2]"));
const nonce = driver.findElement(By.xpath("//div[@class='col-md-6'][2]/table//tr[5]/td[2]"));
const nextBlock = driver.findElement(By.xpath("//div[@class='col-md-6'][2]/table//tr[6]/td[2]"));

const trxHash = driver.findElement(By.xpath("//a[contains(@href,'tx/')]"));

this.getBlockId = () => blockId.getText();

Expand Down Expand Up @@ -50,4 +52,4 @@ function BlockPage() {

this.getTrxHash = () => trxHash.getText();
}
module.exports = new BlockPage();
module.exports = BlockPage;
46 changes: 24 additions & 22 deletions lib/test/pages/StatusPage.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
function StatusPage() {
const syncProgress = element(by.xpath('//table//tr[1]//td[2]'));
const currentSyncStatus = element(by.xpath('//table//tr[2]//td[2]'));
const startDate = element(by.xpath('//table//tr[3]//td[2]'));
const initialBlockChainHeight = element(by.xpath('//table//tr[5]//td[2]'));
const syncedBlocks = element(by.xpath('//table//tr[6]//td[2]'));
const skippedBlocks = element(by.xpath('//table//tr[7]//td[2]'));
const syncType = element(by.xpath('//table//tr[8]//td[2]'));

const lastBlockHash = element(by.xpath('//table[2]//tr[1]//td[2]'));
const currentBlockchainTip = element(by.xpath('//table[2]//tr[2]//td[2]'));

const version = element(by.xpath("//h2[contains(text(), 'Dash node information')]/../table//tr[1]//td[2]"));
const protocolVersion = element(by.xpath("//h2[contains(text(), 'Dash node information')]/../table//tr[2]//td[2]"));
const blocks = element(by.xpath("//h2[contains(text(), 'Dash node information')]/../table//tr[3]//td[2]"));
const timeOffset = element(by.xpath("//h2[contains(text(), 'Dash node information')]/../table//tr[4]//td[2]"));
const connections = element(by.xpath("//h2[contains(text(), 'Dash node information')]/../table//tr[5]//td[2]"));
const miningDifficulty = element(by.xpath("//h2[contains(text(), 'Dash node information')]/../table//tr[6]//td[2]"));
const network = element(by.xpath("//h2[contains(text(), 'Dash node information')]/../table//tr[7]//td[2]"));
const proxySetting = element(by.xpath("//h2[contains(text(), 'Dash node information')]/../table//tr[8]//td[2]"));
const infoErrors = element(by.xpath("//h2[contains(text(), 'Dash node information')]/../table//tr[9]//td[2]"));
const { By } = require('selenium-webdriver');

function StatusPage(driver) {
const syncProgress = driver.findElement(By.xpath('//table//tr[1]//td[2]'));
const currentSyncStatus = driver.findElement(By.xpath('//table//tr[2]//td[2]'));
const startDate = driver.findElement(By.xpath('//table//tr[3]//td[2]'));
const initialBlockChainHeight = driver.findElement(By.xpath('//table//tr[5]//td[2]'));
const syncedBlocks = driver.findElement(By.xpath('//table//tr[6]//td[2]'));
const skippedBlocks = driver.findElement(By.xpath('//table//tr[7]//td[2]'));
const syncType = driver.findElement(By.xpath('//table//tr[8]//td[2]'));

const lastBlockHash = driver.findElement(By.xpath('//table[2]//tr[1]//td[2]'));
const currentBlockchainTip = driver.findElement(By.xpath('//table[2]//tr[2]//td[2]'));

const version = driver.findElement(By.xpath("//h2[contains(text(), 'Dash node information')]/../table//tr[1]//td[2]"));
const protocolVersion = driver.findElement(By.xpath("//h2[contains(text(), 'Dash node information')]/../table//tr[2]//td[2]"));
const blocks = driver.findElement(By.xpath("//h2[contains(text(), 'Dash node information')]/../table//tr[3]//td[2]"));
const timeOffset = driver.findElement(By.xpath("//h2[contains(text(), 'Dash node information')]/../table//tr[4]//td[2]"));
const connections = driver.findElement(By.xpath("//h2[contains(text(), 'Dash node information')]/../table//tr[5]//td[2]"));
const miningDifficulty = driver.findElement(By.xpath("//h2[contains(text(), 'Dash node information')]/../table//tr[6]//td[2]"));
const network = driver.findElement(By.xpath("//h2[contains(text(), 'Dash node information')]/../table//tr[7]//td[2]"));
const proxySetting = driver.findElement(By.xpath("//h2[contains(text(), 'Dash node information')]/../table//tr[8]//td[2]"));
const infoErrors = driver.findElement(By.xpath("//h2[contains(text(), 'Dash node information')]/../table//tr[9]//td[2]"));


this.getSyncProgress = () => syncProgress.getText();
Expand Down Expand Up @@ -57,4 +59,4 @@ function StatusPage() {

this.getInfoErrors = () => infoErrors.getText();
}
module.exports = new StatusPage();
module.exports = StatusPage;
11 changes: 6 additions & 5 deletions lib/test/pages/TopPanel.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
function TopPanel() {
const openBlockPage = element(by.xpath("//a[@href='blocks']"));
const openStatusPage = element(by.xpath("//a[@href='status']"));
const search = element(by.id('search'));
const { By } = require('selenium-webdriver');

function TopPanel(driver) {
const openBlockPage = driver.findElement(By.xpath('//a[@href=\'blocks\']'));
const openStatusPage = driver.findElement(By.xpath('//a[@href=\'status\']'));
const search = driver.findElement(By.id('search'));

this.search = (text) => {
search.sendKeys(text);
Expand All @@ -17,4 +18,4 @@ function TopPanel() {
openStatusPage.click();
};
}
module.exports = new TopPanel();
module.exports = TopPanel;
69 changes: 0 additions & 69 deletions lib/test/service-ctl/InsightUI.js

This file was deleted.

102 changes: 0 additions & 102 deletions lib/test/service-ctl/InsightUIOptions.js

This file was deleted.

36 changes: 0 additions & 36 deletions lib/test/service-ctl/createInsightUI.js

This file was deleted.

Loading
Loading