Skip to content

Commit

Permalink
Angular 13 (#373)
Browse files Browse the repository at this point in the history
  • Loading branch information
directcuteo authored Jun 20, 2022
1 parent ed66903 commit a3e1e8f
Show file tree
Hide file tree
Showing 102 changed files with 19,000 additions and 25,545 deletions.
16 changes: 8 additions & 8 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ steps:
detach: true
privileged: true
environment:
API: '[{"id":"develop.dev.tezedge.com","type":"tezedge","name":"drone-test-node","http":"http://develop.dev.tezedge.com:18732","p2p_port":"9732","features": [{ "name": "ws", "url": "ws://develop.dev.tezedge.com:4927" },{ "name": "debugger", "url": "http://develop.dev.tezedge.com:17732" },{ "name": "sandbox", "url": "http://develop.dev.tezedge.com:3030" },{ "name": "commit", "id": "develop" },{ "name": "monitoring" },{"name":"baking"},{ "name": "resources/system", "monitoringUrl": "http://develop.dev.tezedge.com:38732/resources/tezedge" },{ "name": "resources/storage" },{ "name": "mempool" },{ "name": "storage" },{ "name": "network" },{ "name": "logs" },{"name":"open-api"},{"name":"contracts"}]},{"id":"octez","name":"octez.develop.dev.tezedge.com","http":"http://develop.dev.tezedge.com:18733","p2p_port":"9733","type":"octez","features":[{"name":"debugger","url":"http://develop.dev.tezedge.com:17732"},{"name":"sandbox","url":"http://localhost:3030"},{"name":"monitoring"},{"name":"resources/system","monitoringUrl":"http://develop.dev.tezedge.com:38732/resources/ocaml"},{"name":"resources/memory","memoryProfilerUrl":"http://develop.dev.tezedge.com:17832"},{"name":"mempool"},{"name":"network"},{"name":"logs"}]}]'
API: '[{"id":"develop.dev.tezedge.com","type":"tezedge","name":"drone-test-node","http":"http://develop.dev.tezedge.com:18732","tzstats":"https://api.tzstats.com/","p2p_port":"9732","features": [{ "name": "ws", "url": "ws://develop.dev.tezedge.com:4927" },{ "name": "debugger", "url": "http://develop.dev.tezedge.com:17732" },{ "name": "sandbox", "url": "http://develop.dev.tezedge.com:3030" },{ "name": "commit", "id": "develop" },{ "name": "monitoring" },{"name":"rewards"},{ "name": "resources/system", "monitoringUrl": "http://develop.dev.tezedge.com:38732/resources/tezedge" },{ "name": "resources/storage" },{ "name": "mempool" },{ "name": "storage" },{ "name": "network" },{ "name": "logs" },{"name":"open-api"},{"name":"contracts"}]},{"id":"octez","name":"octez.develop.dev.tezedge.com","http":"http://develop.dev.tezedge.com:18733","p2p_port":"9733","type":"octez","features":[{"name":"debugger","url":"http://develop.dev.tezedge.com:17732"},{"name":"sandbox","url":"http://localhost:3030"},{"name":"monitoring"},{"name":"resources/system","monitoringUrl":"http://develop.dev.tezedge.com:38732/resources/ocaml"},{"name":"resources/memory","memoryProfilerUrl":"http://develop.dev.tezedge.com:17832"},{"name":"mempool"},{"name":"network"},{"name":"logs"}]}]'
# API: '[{"id":"tezedge.master.dev.tezedge.com","name":"tezedge.master.dev.tezedge.com","http":"https://master.dev.tezedge.com:8752","p2p_port":"9732","type":"tezedge","features":[{"name":"ws","url":"wss://master.dev.tezedge.com:443"},{"name":"debugger","url":"https://master.dev.tezedge.com:8753"},{"name":"sandbox","url":"http://localhost:3030"},{"name":"commit","id":""},{"name":"monitoring"},{"name":"resources/system","monitoringUrl":"https://master.dev.tezedge.com:8754/resources/tezedge"},{"name":"resources/memory","memoryProfilerUrl":"https://master.dev.tezedge.com:8764"},{"name":"resources/storage"},{"name":"mempool"},{"name":"storage"},{"name":"network"},{"name":"logs"},{"name":"state"},{"name":"open-api"},{"name":"contracts"}]}]'
depends_on:
- build
Expand Down Expand Up @@ -94,10 +94,10 @@ steps:
depends_on:
- build

- name: test-baking
- name: test-rewards
image: cypress/included:9.5.2
commands:
- cypress run --spec "cypress/integration/baking/baking.spec.js"
- cypress run --spec "cypress/integration/rewards/rewards.spec.js"
environment:
CYPRESS_baseUrl: http://frontend-server:80
depends_on:
Expand Down Expand Up @@ -260,7 +260,7 @@ steps:
- test-mempool-endorsements
- test-mempool-statistics
- test-github-version
- test-baking
- test-rewards
- test-network
- test-open-api
- test-system-resources
Expand Down Expand Up @@ -325,7 +325,7 @@ steps:
detach: true
privileged: true
environment:
API: '[{"id":"develop.dev.tezedge.com","type":"tezedge","name":"drone-test-node","http":"http://develop.dev.tezedge.com:18732","p2p_port":"9732","features": [{ "name": "ws", "url": "ws://develop.dev.tezedge.com:4927" },{ "name": "debugger", "url": "http://develop.dev.tezedge.com:17732" },{"name":"baking"},{ "name": "sandbox", "url": "http://develop.dev.tezedge.com:3030" },{ "name": "commit", "id": "develop" },{ "name": "monitoring" },{ "name": "resources/system", "monitoringUrl": "http://develop.dev.tezedge.com:38732/resources/tezedge" },{ "name": "resources/storage" },{ "name": "mempool" },{ "name": "storage" },{ "name": "network" },{ "name": "logs" },{"name":"open-api"},{"name":"contracts"}]},{"id":"octez","name":"octez.develop.dev.tezedge.com","http":"http://develop.dev.tezedge.com:18733","p2p_port":"9733","type":"octez","features":[{"name":"debugger","url":"http://develop.dev.tezedge.com:17732"},{"name":"sandbox","url":"http://localhost:3030"},{"name":"monitoring"},{"name":"resources/system","monitoringUrl":"http://develop.dev.tezedge.com:38732/resources/ocaml"},{"name":"resources/memory","memoryProfilerUrl":"http://develop.dev.tezedge.com:17832"},{"name":"mempool"},{"name":"network"},{"name":"logs"}]}]'
API: '[{"id":"develop.dev.tezedge.com","type":"tezedge","name":"drone-test-node","http":"http://develop.dev.tezedge.com:18732","tzstats":"https://api.tzstats.com/","p2p_port":"9732","features": [{ "name": "ws", "url": "ws://develop.dev.tezedge.com:4927" },{ "name": "debugger", "url": "http://develop.dev.tezedge.com:17732" },{"name":"rewards"},{ "name": "sandbox", "url": "http://develop.dev.tezedge.com:3030" },{ "name": "commit", "id": "develop" },{ "name": "monitoring" },{ "name": "resources/system", "monitoringUrl": "http://develop.dev.tezedge.com:38732/resources/tezedge" },{ "name": "resources/storage" },{ "name": "mempool" },{ "name": "storage" },{ "name": "network" },{ "name": "logs" },{"name":"open-api"},{"name":"contracts"}]},{"id":"octez","name":"octez.develop.dev.tezedge.com","http":"http://develop.dev.tezedge.com:18733","p2p_port":"9733","type":"octez","features":[{"name":"debugger","url":"http://develop.dev.tezedge.com:17732"},{"name":"sandbox","url":"http://localhost:3030"},{"name":"monitoring"},{"name":"resources/system","monitoringUrl":"http://develop.dev.tezedge.com:38732/resources/ocaml"},{"name":"resources/memory","memoryProfilerUrl":"http://develop.dev.tezedge.com:17832"},{"name":"mempool"},{"name":"network"},{"name":"logs"}]}]'
# API: '[{"id":"tezedge.master.dev.tezedge.com","name":"tezedge.master.dev.tezedge.com","http":"https://master.dev.tezedge.com:8752","p2p_port":"9732","type":"tezedge","features":[{"name":"ws","url":"wss://master.dev.tezedge.com:443"},{"name":"debugger","url":"https://master.dev.tezedge.com:8753"},{"name":"sandbox","url":"http://localhost:3030"},{"name":"commit","id":""},{"name":"monitoring"},{"name":"resources/system","monitoringUrl":"https://master.dev.tezedge.com:8754/resources/tezedge"},{"name":"resources/memory","memoryProfilerUrl":"https://master.dev.tezedge.com:8764"},{"name":"resources/storage"},{"name":"mempool"},{"name":"storage"},{"name":"network"},{"name":"logs"},{"name":"state"},{"name":"open-api"},{"name":"contracts"}]}]'
depends_on:
- build
Expand All @@ -339,10 +339,10 @@ steps:
depends_on:
- build

- name: test-baking
- name: test-rewards
image: cypress/included:9.5.2
commands:
- cypress run --spec "cypress/integration/baking/baking.spec.js"
- cypress run --spec "cypress/integration/rewards/rewards.spec.js"
environment:
CYPRESS_baseUrl: http://frontend-server:80
depends_on:
Expand Down Expand Up @@ -562,7 +562,7 @@ steps:
depends_on:
- test-app
- test-logs
- test-baking
- test-rewards
- test-mempool-pending
- test-mempool-baking-rights
- test-mempool-block-application
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@ testem.log
# System Files
.DS_Store
Thumbs.db
.angular
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@ FROM node:16 AS BUILD_IMAGE
WORKDIR /app

# install angular cli
RUN npm install -g @angular/cli@12.2.2
RUN npm install -g @angular/cli

# clone & install deps for repo
ARG branch=develop
ARG node_explorer_git="https://github.com/tezedge/tezedge-explorer"
RUN git clone ${node_explorer_git} && \
cd tezedge-explorer && \
git checkout ${branch} && \
npm install --save --legacy-peer-deps && \
node path.js
npm install --save --legacy-peer-deps

# change dir to angular app
WORKDIR /app/tezedge-explorer
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ Additionally, if you want to see the real time progress of the tests use the fol

To run the test make sure the application is running and in a separate terminal.
To run the baking rewards transaction test run the following:
`npx cypress run --spec "cypress/integration/baking/baking-rewards.spec.js" --headed`
`npx cypress run --spec "cypress/integration/rewards/ledger-transaction.spec.js" --headed`


## Using Icons Inside TezEdge Explorer
Expand Down
5 changes: 5 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"cli": {
"cache": {
"enabled": false
}
},
"newProjectRoot": "projects",
"projects": {
"tezos-node-explorer": {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
context('BAKING REWARDS', () => {
context('LEDGER TRANSACTION', () => {

it('[BAKING REWARDS] should send batch transactions', () => {
it('[LEDGER TRANSACTION] should send batch transactions', () => {
localStorage.setItem('sidenavCollapsed', 'true');
cy.intercept('/chains/main/blocks/head~2/metadata', { fixture: 'baking/metadata.json' }).as('getMetadata');
cy.intercept('/dev/rewards/cycle/169', { fixture: 'baking/bakers.json' }).as('getBakers');
cy.intercept('/dev/rewards/cycle/169/*', { fixture: 'baking/delegators.json' }).as('getDelegators');
cy.visit(Cypress.config().baseUrl + '/#/baking', { timeout: 100000 });
cy.intercept('/chains/main/blocks/head~2/metadata', { fixture: 'rewards/metadata.json' }).as('getMetadata');
cy.intercept('/dev/rewards/cycle/169', { fixture: 'rewards/bakers.json' }).as('getBakers');
cy.intercept('/dev/rewards/cycle/169/*', { fixture: 'rewards/delegators.json' }).as('getDelegators');
cy.visit(Cypress.config().baseUrl + '/#/rewards', { timeout: 100000 });

let clicked = false;
let angular;
Expand All @@ -15,29 +15,29 @@ context('BAKING REWARDS', () => {
})
.its('store')
.then(store => {
store.select('baking').subscribe(baking => {
if (baking.bakers.length && !clicked) {
store.select('rewards').subscribe(rewards => {
if (rewards.bakers.length && !clicked) {
clicked = true;
const baker = baking.bakers[0];
cy.get('app-baking-delegates-table cdk-virtual-scroll-viewport')
const baker = rewards.bakers[0];
cy.get('app-rewards-delegates-table cdk-virtual-scroll-viewport')
.find('.row')
.wait(1000)
.eq(0)
.trigger('click')
.url()
.should('include', '/baking/' + baker.hash)
.get('app-baking-delegators-table .overflow-auto')
.should('include', '/rewards/' + baker.hash)
.get('app-rewards-delegators-table .overflow-auto')
.scrollTo('right')
.get('.row.head span:nth-child(6)')
.click()
.wait(2000)
.get('app-baking-summary .summary-box .custom-bottom-form-field input')
.get('app-rewards-summary .summary-box .custom-bottom-form-field input')
.eq(0)
.clear()
.type('10', { force: true })
.blur()
.wait(4000)
.get('app-baking-summary form button.blue-btn')
.get('app-rewards-summary form button.blue-btn')
.trigger('click')
.wait(2000)
.then(() => cy.document())
Expand All @@ -55,25 +55,25 @@ context('BAKING REWARDS', () => {
.get('body .cdk-overlay-container mat-dialog-container mat-stepper #cdk-step-content-0-0 button.blue-btn')
.trigger('click')
.wait(2000)
.intercept('/tables/op?columns=status,hash,sender,receiver&type=transaction&cycle=170&limit=50000', { fixture: 'baking/tzstatsNonMatchingResponse.json' })
.intercept('/tables/op?columns=status,hash,sender,receiver&type=transaction&cycle=170&limit=50000', { fixture: 'rewards/tzstatsNonMatchingResponse.json' })
.as('getTzStatsNonMatchingOperations')
.get('body .cdk-overlay-container mat-dialog-container mat-stepper #cdk-step-content-0-1 button.blue-btn')
.trigger('click')
.wait(5000)
.intercept('/tables/op?columns=status,hash,sender,receiver&type=transaction&cycle=170&limit=50000', { fixture: 'baking/tzstatsOperationsTable.json' })
.intercept('/tables/op?columns=status,hash,sender,receiver&type=transaction&cycle=170&limit=50000', { fixture: 'rewards/tzstatsOperationsTable.json' })
.as('getTzStatsOperations')
.get('app-baking-batch-list cdk-virtual-scroll-viewport .batch:nth-child(1) button')
.get('app-rewards-batch-list cdk-virtual-scroll-viewport .batch:nth-child(1) button')
.click({ scrollBehavior: false })
.wait(5000)
.get('body .cdk-overlay-container mat-dialog-container button.blue-btn')
.trigger('click')
.get('app-baking-delegators-table cdk-virtual-scroll-viewport .row span:last-child mat-icon.icon-light-green', { timeout: 20000 })
.get('app-rewards-delegators-table cdk-virtual-scroll-viewport .row span:last-child mat-icon.icon-light-green', { timeout: 20000 })
.then(el => {
expect(el.length).to.be.greaterThan(0);
})
.get('app-baking-batch-list cdk-virtual-scroll-viewport .batch:nth-child(1) .link')
.get('app-rewards-batch-list cdk-virtual-scroll-viewport .batch:nth-child(1) .link')
.then(el => expect(el.text()).to.includes('View in TzStats'))
.get('app-baking-batch-list cdk-virtual-scroll-viewport .batch:nth-child(1) div.flex-row div.flex-row:nth-child(2)')
.get('app-rewards-batch-list cdk-virtual-scroll-viewport .batch:nth-child(1) div.flex-row div.flex-row:nth-child(2)')
.then(el => expect(el.text()).to.includes('Distributed'))
.wait(2000);
}
Expand Down
Loading

0 comments on commit a3e1e8f

Please sign in to comment.