diff --git a/Dockerfile b/Dockerfile index be615fe2..19d94214 100644 --- a/Dockerfile +++ b/Dockerfile @@ -40,9 +40,9 @@ COPY yarn.lock /trezor-wallet RUN yarn COPY . /trezor-wallet RUN yarn run build:stable -RUN yarn test-integration + # # run # ENTRYPOINT ["/trezor-wallet/test/docker/run-all.sh"] -EXPOSE 8080 \ No newline at end of file +EXPOSE 8080 21325 \ No newline at end of file diff --git a/package.json b/package.json index 5809aad5..e0c4e428 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "test:unit": "npx jest", "test-unit:watch": "npx jest -o --watch", "test-integration": "npx cypress run", - "test-local": "npx cypress open", + "test-integration:local": "npx cypress open", "server:beta": "node ./server/index.js --buildType=beta", "server:stable": "node ./server/index.js --buildType=stable" }, diff --git a/src/components/Button/index.js b/src/components/Button/index.js index c0704b56..557e4927 100644 --- a/src/components/Button/index.js +++ b/src/components/Button/index.js @@ -132,10 +132,12 @@ const Button = ({ isWhite = false, isWebUsb = false, isTransparent = false, + dataTest, }: Props) => { const newClassName = isWebUsb ? `${className} trezor-webusb-button` : className; return ( { const status = getStatus(device); return ( void }) => ( /> Please note that the Trezor Beta Wallet might be collecting anonymized usage data, especially error logs, for development purposes. The Trezor Wallet does not log any data. - OK, I understand + OK, I understand ); diff --git a/src/views/Wallet/components/LeftNavigation/components/CoinMenu/index.js b/src/views/Wallet/components/LeftNavigation/components/CoinMenu/index.js index 6d262662..194932e7 100644 --- a/src/views/Wallet/components/LeftNavigation/components/CoinMenu/index.js +++ b/src/views/Wallet/components/LeftNavigation/components/CoinMenu/index.js @@ -57,7 +57,7 @@ class CoinMenu extends PureComponent { render() { const { config } = this.props.localStorage; return ( - + {config.networks.map(item => ( { ))} (

{textLeft}

@@ -33,6 +37,7 @@ Divider.propTypes = { textLeft: PropTypes.string, textRight: PropTypes.string, hasBorder: PropTypes.bool, + testId: PropTypes.string, }; export default Divider; diff --git a/src/views/Wallet/components/LeftNavigation/index.js b/src/views/Wallet/components/LeftNavigation/index.js index cca5eab1..e0376983 100644 --- a/src/views/Wallet/components/LeftNavigation/index.js +++ b/src/views/Wallet/components/LeftNavigation/index.js @@ -191,6 +191,7 @@ class LeftNavigation extends React.PureComponent { >
{ if (isDeviceAccessible || this.props.devices.length > 1) { diff --git a/test/docker/run-all.sh b/test/docker/run-all.sh index 131b6b09..8bb96892 100755 --- a/test/docker/run-all.sh +++ b/test/docker/run-all.sh @@ -12,3 +12,6 @@ cd /trezor-emulator/trezor-core && ./emu.sh & # run wallet cd /trezor-wallet && yarn run server:stable + +# run tests +yarn run test-integration -c baseUrl="https://localhost:8081/#/" diff --git a/test/integration/landingPage.js b/test/integration/landingPage.js deleted file mode 100644 index 87952357..00000000 --- a/test/integration/landingPage.js +++ /dev/null @@ -1,24 +0,0 @@ -describe('Landing Page', () => { - beforeEach(() => { - cy.visit('http://localhost:8081/#/'); - cy.get('[data-test=beta-disclaimer-button]').click(); - }); - - it('top menu', () => { - cy.get('[data-test=top-menu]') - .should('be.visible') - .matchImageSnapshot(); - }); - - it('main text', () => { - cy.get('[data-test=landing-main-title]') - .should('be.visible') - .matchImageSnapshot(); - }); - - it('footer', () => { - cy.get('[data-test=footer]') - .should('be.visible') - .matchImageSnapshot(); - }); -}); \ No newline at end of file diff --git a/test/integration/left-menu.js b/test/integration/left-menu.js new file mode 100644 index 00000000..9d0ed6c3 --- /dev/null +++ b/test/integration/left-menu.js @@ -0,0 +1,12 @@ +describe('Left Menu', () => { + beforeEach(() => { + cy.visit('https://localhost:8080/#/'); + cy.getTestElement('Modal__disclaimer__button__confirm').click(); + }); + + it('divider', () => { + cy.getTestElement('Main__page__coin__menu__divider') + .should('be.visible') + .matchImageSnapshot(); + }); +}); \ No newline at end of file diff --git a/test/screenshots/landingPage.js/Landing Page -- top menu -- before each hook (failed).png b/test/screenshots/landingPage.js/Landing Page -- top menu -- before each hook (failed).png deleted file mode 100644 index bff5d8d3..00000000 Binary files a/test/screenshots/landingPage.js/Landing Page -- top menu -- before each hook (failed).png and /dev/null differ diff --git a/test/screenshots/left-menu/body.js/Left Menu - body -- top menu (failed).png b/test/screenshots/left-menu/body.js/Left Menu - body -- top menu (failed).png new file mode 100644 index 00000000..9e16bfb8 Binary files /dev/null and b/test/screenshots/left-menu/body.js/Left Menu - body -- top menu (failed).png differ diff --git a/test/snapshots/All Specs/Left Menu -- divider.snap.png b/test/snapshots/All Specs/Left Menu -- divider.snap.png new file mode 100644 index 00000000..d4405d75 Binary files /dev/null and b/test/snapshots/All Specs/Left Menu -- divider.snap.png differ diff --git a/test/snapshots/landingPage.js/Landing Page -- footer.snap.png b/test/snapshots/landingPage.js/Landing Page -- footer.snap.png deleted file mode 100644 index 9dadb87e..00000000 Binary files a/test/snapshots/landingPage.js/Landing Page -- footer.snap.png and /dev/null differ diff --git a/test/snapshots/landingPage.js/Landing Page -- main text.snap.png b/test/snapshots/landingPage.js/Landing Page -- main text.snap.png deleted file mode 100644 index 6570547d..00000000 Binary files a/test/snapshots/landingPage.js/Landing Page -- main text.snap.png and /dev/null differ diff --git a/test/snapshots/landingPage.js/Landing Page -- top menu.snap.png b/test/snapshots/landingPage.js/Landing Page -- top menu.snap.png deleted file mode 100644 index a3a82186..00000000 Binary files a/test/snapshots/landingPage.js/Landing Page -- top menu.snap.png and /dev/null differ diff --git a/test/support/commands.js b/test/support/commands.js index 57281651..1430fb7e 100644 --- a/test/support/commands.js +++ b/test/support/commands.js @@ -1,3 +1,5 @@ import { addMatchImageSnapshotCommand } from 'cypress-image-snapshot/command'; -addMatchImageSnapshotCommand(); \ No newline at end of file +addMatchImageSnapshotCommand(); + +Cypress.Commands.add('getTestElement', selector => cy.get(`[data-test="${selector}"]`));