mirror of https://github.com/trezor/trezor-wallet
commit
8f6ec4eadd
@ -1,17 +1,50 @@
|
|||||||
FROM node:9.3
|
FROM python:latest
|
||||||
|
|
||||||
ARG BUILD_TYPE=stable
|
#
|
||||||
|
# setup
|
||||||
|
#
|
||||||
|
RUN apt-get update
|
||||||
|
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
|
||||||
|
RUN apt-get install -y chromium libappindicator3-1 xdg-utils fonts-liberation nodejs wget dpkg git python python3 python3-pip xvfb libgtk2.0-0 libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2
|
||||||
|
RUN npm install -g yarn
|
||||||
|
|
||||||
WORKDIR /trezor-wallet-app
|
RUN ln -s /usr/bin/chromium /usr/local/bin/chromium-browser
|
||||||
|
|
||||||
COPY package.json /trezor-wallet-app
|
#
|
||||||
COPY yarn.lock /trezor-wallet-app
|
# build emulator
|
||||||
|
#
|
||||||
|
RUN mkdir /trezor-emulator
|
||||||
|
WORKDIR /trezor-emulator
|
||||||
|
|
||||||
RUN yarn install
|
RUN git clone https://github.com/trezor/trezor-core
|
||||||
|
WORKDIR /trezor-emulator/trezor-core
|
||||||
|
RUN git submodule update --init --recursive
|
||||||
|
|
||||||
COPY . /trezor-wallet-app
|
RUN apt-get install libusb-1.0-0
|
||||||
|
RUN pip3 install scons trezor
|
||||||
|
RUN make build_unix_noui
|
||||||
|
|
||||||
RUN yarn run build:${BUILD_TYPE}
|
#
|
||||||
|
# install bridge
|
||||||
|
#
|
||||||
|
RUN mkdir /trezor-bridge
|
||||||
|
WORKDIR /trezor-bridge
|
||||||
|
RUN wget https://wallet.trezor.io/data/bridge/2.0.25/trezor-bridge_2.0.25_amd64.deb
|
||||||
|
RUN dpkg -x /trezor-bridge/trezor-bridge_2.0.25_amd64.deb /trezor-bridge/extracted
|
||||||
|
|
||||||
EXPOSE 8080
|
#
|
||||||
CMD [ "yarn", "run", "prod-server" ]
|
# install trezor-wallet
|
||||||
|
#
|
||||||
|
RUN mkdir /trezor-wallet
|
||||||
|
WORKDIR /trezor-wallet
|
||||||
|
COPY package.json /trezor-wallet
|
||||||
|
COPY yarn.lock /trezor-wallet
|
||||||
|
RUN yarn
|
||||||
|
COPY . /trezor-wallet
|
||||||
|
RUN yarn run build:stable
|
||||||
|
|
||||||
|
#
|
||||||
|
# run
|
||||||
|
#
|
||||||
|
ENTRYPOINT ["/trezor-wallet/test/scripts/run-all.sh"]
|
||||||
|
EXPOSE 8080 21325
|
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"integrationFolder": "test/integration",
|
||||||
|
"fixturesFolder": "test/fixtures",
|
||||||
|
"pluginsFile": "test/plugins/index.js",
|
||||||
|
"supportFile": "test/support/index.js",
|
||||||
|
"defaultCommandTimeout": 10000,
|
||||||
|
"screenshotsFolder": "test/screenshots",
|
||||||
|
"video": false,
|
||||||
|
"trashAssetsBeforeRuns": true,
|
||||||
|
"chromeWebSecurity": false
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
describe('Dashboard page', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1366, 1800);
|
||||||
|
cy.visit('/');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('navigation', () => {
|
||||||
|
cy.getTestElement('Main__page__navigation')
|
||||||
|
.should('be.visible')
|
||||||
|
.matchImageSnapshot();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('content', () => {
|
||||||
|
cy.getTestElement('Dashboard__page__content')
|
||||||
|
.should('be.visible')
|
||||||
|
.matchImageSnapshot();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Menu
|
||||||
|
|
||||||
|
it('device header', () => {
|
||||||
|
cy.getTestElement('Main__page__device__header')
|
||||||
|
.should('be.visible')
|
||||||
|
.matchImageSnapshot();
|
||||||
|
});
|
||||||
|
});
|
@ -0,0 +1,7 @@
|
|||||||
|
const {
|
||||||
|
addMatchImageSnapshotPlugin,
|
||||||
|
} = require('cypress-image-snapshot/plugin');
|
||||||
|
|
||||||
|
module.exports = (on) => {
|
||||||
|
addMatchImageSnapshotPlugin(on);
|
||||||
|
};
|
@ -0,0 +1,6 @@
|
|||||||
|
import '@babel/polyfill';
|
||||||
|
import { initSeedAllDevice } from 'trezor-bridge-communicator';
|
||||||
|
|
||||||
|
(async () => {
|
||||||
|
await initSeedAllDevice();
|
||||||
|
})();
|
@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# go to root
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
# run bridge
|
||||||
|
cd /trezor-bridge && ./extracted/usr/bin/trezord -ed 21324:21325 -u=false &
|
||||||
|
|
||||||
|
# run emulator
|
||||||
|
cd /trezor-emulator/trezor-core && PYOPT=0 ./emu.sh &
|
||||||
|
|
||||||
|
# run wallet
|
||||||
|
cd /trezor-wallet && yarn run server:stable &
|
||||||
|
|
||||||
|
# init device
|
||||||
|
npx babel-node /trezor-wallet/test/scripts/init-device.js &
|
||||||
|
|
||||||
|
# run tests
|
||||||
|
yarn run test-integration:gitlab -c baseUrl="https://localhost:8080/#/"
|
After Width: | Height: | Size: 33 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 13 KiB |
@ -0,0 +1,5 @@
|
|||||||
|
import { addMatchImageSnapshotCommand } from 'cypress-image-snapshot/command';
|
||||||
|
|
||||||
|
addMatchImageSnapshotCommand();
|
||||||
|
|
||||||
|
Cypress.Commands.add('getTestElement', selector => cy.get(`[data-test="${selector}"]`));
|
@ -0,0 +1,5 @@
|
|||||||
|
import './commands';
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
window.localStorage.setItem('/betaModalPrivacy', true);
|
||||||
|
});
|
Loading…
Reference in new issue