From 708782fdf99b58d7eca772cfea35f431fadd452b Mon Sep 17 00:00:00 2001 From: benedettadavico Date: Thu, 10 Nov 2022 10:27:11 +0100 Subject: [PATCH 01/12] WIP --- nym-wallet/src/components/textfields.tsx | 1 + nym-wallet/wallet-fe-tests/package.json | 3 +- .../test/pageobjects/authScreens.ts | 4 +- .../test/specs/login/passwordlogin.spec.ts | 80 +++++------ nym-wallet/wallet-fe-tests/test/wdio.conf.ts | 35 ++--- nym-wallet/wallet-fe-tests/yarn.lock | 125 +++++++++++++++++- 6 files changed, 189 insertions(+), 59 deletions(-) diff --git a/nym-wallet/src/components/textfields.tsx b/nym-wallet/src/components/textfields.tsx index 085ede1ab3..f48b5e6b8f 100644 --- a/nym-wallet/src/components/textfields.tsx +++ b/nym-wallet/src/components/textfields.tsx @@ -22,6 +22,7 @@ export const MnemonicInput: React.FC<{ autoFocus fullWidth inputProps={{ + "data-testid": "inputMnemonic", style: { height: '160px', }, diff --git a/nym-wallet/wallet-fe-tests/package.json b/nym-wallet/wallet-fe-tests/package.json index cb6477569b..e9ca397e2a 100644 --- a/nym-wallet/wallet-fe-tests/package.json +++ b/nym-wallet/wallet-fe-tests/package.json @@ -13,7 +13,8 @@ "@types/mocha": "^9.1.1", "prettier": "2.5.1", "typescript": "^4.6.2", - "@nymproject/nym-validator-client": "0.18.0" + "@nymproject/nym-validator-client": "0.18.0", + "@wdio/allure-reporter": "^7.0.0" }, "scripts": { "test": "wdio run test/wdio.conf.ts", diff --git a/nym-wallet/wallet-fe-tests/test/pageobjects/authScreens.ts b/nym-wallet/wallet-fe-tests/test/pageobjects/authScreens.ts index 8f23d6b943..40ac1be09e 100644 --- a/nym-wallet/wallet-fe-tests/test/pageobjects/authScreens.ts +++ b/nym-wallet/wallet-fe-tests/test/pageobjects/authScreens.ts @@ -12,8 +12,8 @@ class Auth { get forgotPassword(): Promise { return $("[data-testid='forgotPassword']") } // Sign in with mnemonic page - get mnemonicLoginScreenHeader(): Promise { return $("[data-testid='Enter a mnemonic to sign in']") } //check - get mnemonicInput(): Promise { return $("[data-testid='mnemonicInput']") } //check + get mnemonicLoginScreenHeader(): Promise { return $("[data-testid='Enter a mnemonic to sign in']") } + get mnemonicInput(): Promise { return $("[data-testid='inputMnemonic']") } get signIn(): Promise { return $("[data-testid='signInWithMnemonicButton']") } get backToSignInOptions(): Promise { return $("[data-testid='backToSignInOptions']") } get createPassword(): Promise { return $("[data-testid='goToCreatePassword']") } diff --git a/nym-wallet/wallet-fe-tests/test/specs/login/passwordlogin.spec.ts b/nym-wallet/wallet-fe-tests/test/specs/login/passwordlogin.spec.ts index df080b8b56..d2c3ccafed 100644 --- a/nym-wallet/wallet-fe-tests/test/specs/login/passwordlogin.spec.ts +++ b/nym-wallet/wallet-fe-tests/test/specs/login/passwordlogin.spec.ts @@ -8,7 +8,7 @@ const deleteWallet = require("../../../scripts/deletesavedwallet"); const walletExists = require("../../../scripts/savedwalletexists"); const Helper = require('../../../common/helper'); -describe.skip('Create password for existing account and use it to sign in', () => { +describe('Create password for existing account and use it to sign in', () => { it('enter incorrect mnemonic', async () => { @@ -39,68 +39,70 @@ describe.skip('Create password for existing account and use it to sign in', () = it('enter correct mnemonic', async () => { // generate random mnemonic in the backend - const randomMnemonic = ValidatorClient.randomMnemonic(); + const randomMnemonic = ValidatorClient.randomMnemonic().toString; deleteScript + console.log("THGARUHGHAGJAHG " + randomMnemonic) // use it to continue with password creation flow await Helper.navigateAndClick(Auth.backToMnemonicSignIn) await Helper.navigateAndClick(Auth.createPassword) await Helper.addValueToTextField(Auth.mnemonicInput, randomMnemonic) + await Helper.navigateAndClick(Auth.) await Helper.navigateAndClick(Auth.nextToPasswordCreation) await Helper.elementVisible(Auth.password) }) - it('create an invalid password', async () => { +// it('create an invalid password', async () => { - // type an invalid password in both fields - await Helper.addValueToTextField(Auth.password, textConstants.incorrectPassword) - await Helper.navigateAndClick(Auth.confirmPassword) - await Helper.addValueToTextField(Auth.confirmPassword, textConstants.incorrectPassword) - // ensure the button to proceed is still disabled - const nextButton = await Auth.createPasswordButton - const isNextDisabled = await nextButton.getAttribute('disabled') - expect(isNextDisabled).toBe("true") +// // type an invalid password in both fields +// await Helper.addValueToTextField(Auth.password, textConstants.incorrectPassword) +// await Helper.navigateAndClick(Auth.confirmPassword) +// await Helper.addValueToTextField(Auth.confirmPassword, textConstants.incorrectPassword) +// // ensure the button to proceed is still disabled +// const nextButton = await Auth.createPasswordButton +// const isNextDisabled = await nextButton.getAttribute('disabled') +// expect(isNextDisabled).toBe("true") - }) +// }) - it('create a valid password', async () => { +// it('create a valid password', async () => { - // type a valid password in both fields - await Helper.navigateAndClick(Auth.password) - await Helper.addValueToTextField(Auth.password, textConstants.password) - await Helper.navigateAndClick(Auth.confirmPassword) - await Helper.addValueToTextField(Auth.confirmPassword, textConstants.password) - // verify the password is created and the next screen is visible - await Helper.navigateAndClick(Auth.createPasswordButton) - await Helper.verifyStrictText(Auth.passwordLoginScreenHeader, textConstants.passwordSignIn) +// // type a valid password in both fields +// await Helper.navigateAndClick(Auth.password) +// await Helper.addValueToTextField(Auth.password, textConstants.password) +// await Helper.navigateAndClick(Auth.confirmPassword) +// await Helper.addValueToTextField(Auth.confirmPassword, textConstants.password) +// // verify the password is created and the next screen is visible +// await Helper.navigateAndClick(Auth.createPasswordButton) +// await Helper.verifyStrictText(Auth.passwordLoginScreenHeader, textConstants.passwordSignIn) - }) +// }) - it('sign in with no password throws error', async () => { +// it('sign in with no password throws error', async () => { - //click sign without entering a password - await Helper.navigateAndClick(Auth.signInPasswordButton) - // wait for error - await Helper.elementVisible(Auth.error) - // verify error has the correct message - await Helper.verifyStrictText(Auth.error, textConstants.signInWithoutPassword) +// //click sign without entering a password +// await Helper.navigateAndClick(Auth.signInPasswordButton) +// // wait for error +// await Helper.elementVisible(Auth.error) +// // verify error has the correct message +// await Helper.verifyStrictText(Auth.error, textConstants.signInWithoutPassword) - }) +// }) - it('sign in with invalid password throws error', async () => { +// it('sign in with invalid password throws error', async () => { - // enter invalid password - await Helper.addValueToTextField(Auth.enterPassword, textConstants.incorrectPassword) - await Helper.navigateAndClick(Auth.signInPasswordButton) - // wait for error - await Helper.elementVisible(Auth.error) - await Helper.verifyStrictText(Auth.error, textConstants.invalidPasswordOnSignIn) +// // enter invalid password +// await Helper.addValueToTextField(Auth.enterPassword, textConstants.incorrectPassword) +// await Helper.navigateAndClick(Auth.signInPasswordButton) +// // wait for error +// await Helper.elementVisible(Auth.error) +// await Helper.verifyStrictText(Auth.error, textConstants.invalidPasswordOnSignIn) - }) +// }) }) -describe('Wallet sign in functionality without creating password', () => { +describe.skip('Wallet sign in functionality without creating password', () => { it('sign in with invalid password and no saved wallet.json file throws error', async () => { diff --git a/nym-wallet/wallet-fe-tests/test/wdio.conf.ts b/nym-wallet/wallet-fe-tests/test/wdio.conf.ts index 72eec5db2c..2616587c97 100644 --- a/nym-wallet/wallet-fe-tests/test/wdio.conf.ts +++ b/nym-wallet/wallet-fe-tests/test/wdio.conf.ts @@ -56,10 +56,10 @@ exports.config = { // Define all options that are relevant for the WebdriverIO instance here // // Level of logging verbosity: trace | debug | info | warn | error | silent - logLevel: 'info', + logLevel: 'error', bail: 0, framework: 'mocha', - // reporters: ['spec'], + // reporters: ['spec'], mochaOpts: { ui: 'bdd', timeout: 60000, @@ -67,28 +67,30 @@ exports.config = { // =================== // Test Reporters // =================== - // reporters: [ - // [ - // "allure", - // { - // outputDir: "allure-results", - // disableWebdriverStepsReporting: true, - // disableWebdriverScreenshotsReporting: true, - // }, - // ], - // ], + reporters: [ + [ + "allure", + { + outputDir: "allure-results", + disableWebdriverStepsReporting: true, + disableWebdriverScreenshotsReporting: true, + }, + ], + ], // this is documentented in the readme - you will need to build the project first // ensure the rust project is built since we expect this binary to exist for the webdriver sessions // ensure we are running `tauri-driver` before the session starts so that we can proxy the webdriver requests + onPrepare: () => { + let scriptpath = process.cwd() + "/scripts/killprocess.sh"; + spawn('bash', [scriptpath]); + }, + beforeSession: () => { - let scriptpath = process.cwd() + "/scripts/killprocess.sh"; - spawn('bash', [scriptpath]); - (tauriDriver = spawn( path.resolve(os.homedir(), '.cargo', 'bin', 'tauri-driver'), [], @@ -99,5 +101,6 @@ exports.config = { // clean up the `tauri-driver` process we spawned at the start of the session - afterSession: () => tauriDriver.kill(), + afterSession: () => + tauriDriver.kill(), } \ No newline at end of file diff --git a/nym-wallet/wallet-fe-tests/yarn.lock b/nym-wallet/wallet-fe-tests/yarn.lock index 8af4557779..88a1aee887 100644 --- a/nym-wallet/wallet-fe-tests/yarn.lock +++ b/nym-wallet/wallet-fe-tests/yarn.lock @@ -313,6 +313,11 @@ "@types/node" "*" "@types/responselike" "*" +"@types/diff@^5.0.0": + version "5.0.2" + resolved "https://registry.yarnpkg.com/@types/diff/-/diff-5.0.2.tgz#dd565e0086ccf8bc6522c6ebafd8a3125c91c12b" + integrity sha512-uw8eYMIReOwstQ0QKF0sICefSy8cNO/v7gOTiIy9SbwuHyEecJUm7qlgueOO5S1udZ5I/irVydHVwMchgzbKTg== + "@types/ejs@^3.0.5": version "3.1.1" resolved "https://registry.yarnpkg.com/@types/ejs/-/ejs-3.1.1.tgz#29c539826376a65e7f7d672d51301f37ed718f6d" @@ -419,6 +424,11 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-13.13.52.tgz#03c13be70b9031baaed79481c0c0cfb0045e53f7" integrity sha512-s3nugnZumCC//n4moGGe6tkNMyYEdaDBitVjwPxXmR5lnMG5dHePinH2EdxkG3Rh1ghFHHixAG4NJhpJW1rthQ== +"@types/object-inspect@^1.8.0": + version "1.8.1" + resolved "https://registry.yarnpkg.com/@types/object-inspect/-/object-inspect-1.8.1.tgz#7c08197ad05cc0e513f529b1f3919cc99f720e1f" + integrity sha512-0JTdf3CGV0oWzE6Wa40Ayv2e2GhpP3pEJMcrlM74vBSJPuuNkVwfDnl0SZxyFCXETcB4oKA/MpTVfuYSMOelBg== + "@types/recursive-readdir@^2.2.0": version "2.2.1" resolved "https://registry.yarnpkg.com/@types/recursive-readdir/-/recursive-readdir-2.2.1.tgz#330f5ec0b73e8aeaf267a6e056884e393f3543a3" @@ -445,6 +455,11 @@ dependencies: "@types/node" "*" +"@types/supports-color@^8.1.0": + version "8.1.1" + resolved "https://registry.yarnpkg.com/@types/supports-color/-/supports-color-8.1.1.tgz#1b44b1b096479273adf7f93c75fc4ecc40a61ee4" + integrity sha512-dPWnWsf+kzIG140B8z2w3fr5D03TLWbOAFQl45xUpI3vcizeXriNR5VYkWZ+WTMsUHqZ9Xlt3hrxGNANFyNQfw== + "@types/through@*": version "0.0.30" resolved "https://registry.yarnpkg.com/@types/through/-/through-0.0.30.tgz#e0e42ce77e897bd6aead6f6ea62aeb135b8a3895" @@ -452,6 +467,11 @@ dependencies: "@types/node" "*" +"@types/tmp@^0.2.0": + version "0.2.3" + resolved "https://registry.yarnpkg.com/@types/tmp/-/tmp-0.2.3.tgz#908bfb113419fd6a42273674c00994d40902c165" + integrity sha512-dDZH/tXzwjutnuk4UacGgFRwV+JSLaXL1ikvidfJprkb7L9Nx1njcRHHmi3Dsvt7pgqqTEeucQuOrWHPFgzVHA== + "@types/ua-parser-js@^0.7.33": version "0.7.36" resolved "https://registry.yarnpkg.com/@types/ua-parser-js/-/ua-parser-js-0.7.36.tgz#9bd0b47f26b5a3151be21ba4ce9f5fa457c5f190" @@ -481,6 +501,18 @@ dependencies: "@types/node" "*" +"@wdio/allure-reporter@^7.0.0": + version "7.25.4" + resolved "https://registry.yarnpkg.com/@wdio/allure-reporter/-/allure-reporter-7.25.4.tgz#8ab1fa2d13da56771a192dec456a14426da7d989" + integrity sha512-Xt2bIc64E0PNwN2PHXL4uLuWosJRqjK52HdMuI7fgXAsvvhcRizv+tDUOrePCZxonveVUJlRKQGX+AJIqrxmng== + dependencies: + "@types/node" "^18.0.0" + "@wdio/reporter" "7.25.4" + "@wdio/types" "7.25.4" + allure-js-commons "^1.3.2" + csv-stringify "^6.0.4" + strip-ansi "^6.0.0" + "@wdio/cli@^7.25.4": version "7.25.4" resolved "https://registry.yarnpkg.com/@wdio/cli/-/cli-7.25.4.tgz#3bb35c6875eb5a10d408a43b2e0f5df65b83287e" @@ -574,6 +606,22 @@ dependencies: "@wdio/utils" "7.25.4" +"@wdio/reporter@7.25.4": + version "7.25.4" + resolved "https://registry.yarnpkg.com/@wdio/reporter/-/reporter-7.25.4.tgz#b6a69652dd0c4ec131255000af128eac403a18b9" + integrity sha512-M37qzEmF5qNffyZmRQGjDlrXqWW21EFvgW8wsv1b/NtfpZc0c0MoRpeh6BnvX1KcE4nCXfjXgSJPOqV4ZCzUEQ== + dependencies: + "@types/diff" "^5.0.0" + "@types/node" "^18.0.0" + "@types/object-inspect" "^1.8.0" + "@types/supports-color" "^8.1.0" + "@types/tmp" "^0.2.0" + "@wdio/types" "7.25.4" + diff "^5.0.0" + fs-extra "^10.0.0" + object-inspect "^1.10.3" + supports-color "8.1.1" + "@wdio/runner@7.25.4": version "7.25.4" resolved "https://registry.yarnpkg.com/@wdio/runner/-/runner-7.25.4.tgz#9bf4fb43bc0c7f3f32a90f53d821962d4d137f63" @@ -612,6 +660,18 @@ agent-base@6: dependencies: debug "4" +allure-js-commons@^1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/allure-js-commons/-/allure-js-commons-1.3.2.tgz#e1cf0466e36695bb3ced1228f6570eac6c2e9eda" + integrity sha512-FTmoqP36ZjHFT4iLdYamyCFhyj1jqD6BIdiZ5pBlyafDJrFRV76XIXNxwRqbHpSw40o1vHzYi4vGpmREnhnHVw== + dependencies: + file-type "^7.7.1" + fs-extra "^6.0.1" + js2xmlparser "^3.0.0" + mime "^2.3.1" + object-assign "^4.1.1" + uuid "^3.0.0" + ansi-colors@4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" @@ -1103,6 +1163,11 @@ css-value@^0.0.1: resolved "https://registry.yarnpkg.com/css-value/-/css-value-0.0.1.tgz#5efd6c2eea5ea1fd6b6ac57ec0427b18452424ea" integrity sha512-FUV3xaJ63buRLgHrLQVlVgQnQdR4yqdLGaDu7g8CQcWjInDfM9plBTPI9FRfpahju1UBSaMckeb2/46ApS/V1Q== +csv-stringify@^6.0.4: + version "6.2.1" + resolved "https://registry.yarnpkg.com/csv-stringify/-/csv-stringify-6.2.1.tgz#de4f9940abd8c9780eda41130c737a18d24e5986" + integrity sha512-+DT/YEgqRy82aMPMA7yUUpFJPx9X8iZy7UhfyTE2bHmFJcjDiz1j29wzTFkYTtuNVceNgz8efsjICch+O1WcLQ== + debug@4, debug@4.3.4, debug@^4.1.1: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" @@ -1214,6 +1279,11 @@ diff@5.0.0: resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b" integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w== +diff@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-5.1.0.tgz#bc52d298c5ea8df9194800224445ed43ffc87e40" + integrity sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw== + edge-paths@^2.1.0: version "2.2.1" resolved "https://registry.yarnpkg.com/edge-paths/-/edge-paths-2.2.1.tgz#d2d91513225c06514aeac9843bfce546abbf4391" @@ -1358,6 +1428,11 @@ figures@^3.0.0: dependencies: escape-string-regexp "^1.0.5" +file-type@^7.7.1: + version "7.7.1" + resolved "https://registry.yarnpkg.com/file-type/-/file-type-7.7.1.tgz#91c2f5edb8ce70688b9b68a90d931bbb6cb21f65" + integrity sha512-bTrKkzzZI6wH+NXhyD3SOXtb2zXTw2SbwI2RxUlRcXVsnN7jNL5hJzVQLYv7FOQhxFkK4XWdAflEaWFpaLLWpQ== + filelist@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/filelist/-/filelist-1.0.4.tgz#f78978a1e944775ff9e62e744424f215e58352b5" @@ -1427,6 +1502,15 @@ fs-extra@^10.0.0: jsonfile "^6.0.1" universalify "^2.0.0" +fs-extra@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-6.0.1.tgz#8abc128f7946e310135ddc93b98bddb410e7a34b" + integrity sha512-GnyIkKhhzXZUWFCaJzvyDLEEgDkPfb4/TPvJCJVuS8MWZgoSsErf++QpiAlDnKFcqhRlm+tIOcencCjyJE6ZCA== + dependencies: + graceful-fs "^4.1.2" + jsonfile "^4.0.0" + universalify "^0.1.0" + fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" @@ -2005,11 +2089,25 @@ js-yaml@4.1.0: dependencies: argparse "^2.0.1" +js2xmlparser@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/js2xmlparser/-/js2xmlparser-3.0.0.tgz#3fb60eaa089c5440f9319f51760ccd07e2499733" + integrity sha512-CSOkdn0/GhRFwxnipmhXfqJ+FG6+wkWBi46kKSsPx6+j65176ZiQcrCYpg6K8x3iLbO4k3zScBnZ7I/L80dAtw== + dependencies: + xmlcreate "^1.0.1" + json-buffer@3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== +jsonfile@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" + integrity sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg== + optionalDependencies: + graceful-fs "^4.1.6" + jsonfile@^6.0.1: version "6.1.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" @@ -2206,6 +2304,11 @@ micromatch@^4.0.4: braces "^3.0.2" picomatch "^2.3.1" +mime@^2.3.1: + version "2.6.0" + resolved "https://registry.yarnpkg.com/mime/-/mime-2.6.0.tgz#a2a682a95cd4d0cb1d6257e28f83da7e35800367" + integrity sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg== + mimic-fn@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" @@ -2353,7 +2456,12 @@ normalize-url@^6.0.1: resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-6.1.0.tgz#40d0885b535deffe3f3147bec877d05fe4c5668a" integrity sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A== -object-inspect@^1.9.0: +object-assign@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== + +object-inspect@^1.10.3, object-inspect@^1.9.0: version "1.12.2" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.2.tgz#c0641f26394532f28ab8d796ab954e43c009a8ea" integrity sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ== @@ -3091,6 +3199,11 @@ unbzip2-stream@1.4.3: buffer "^5.2.1" through "^2.3.8" +universalify@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" + integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== + universalify@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" @@ -3101,6 +3214,11 @@ util-deprecate@^1.0.1, util-deprecate@~1.0.1: resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== +uuid@^3.0.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" + integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== + uuid@^9.0.0: version "9.0.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.0.tgz#592f550650024a38ceb0c562f2f6aa435761efb5" @@ -3258,6 +3376,11 @@ ws@^7: resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591" integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q== +xmlcreate@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/xmlcreate/-/xmlcreate-1.0.2.tgz#fa6bf762a60a413fb3dd8f4b03c5b269238d308f" + integrity sha512-Mbe56Dvj00onbnSo9J0qj/XlY5bfN9KidsOnpd5tRCsR3ekB3hyyNU9fGrTdqNT5ZNvv4BsA2TcQlignsZyVcw== + xstream@^11.14.0: version "11.14.0" resolved "https://registry.yarnpkg.com/xstream/-/xstream-11.14.0.tgz#2c071d26b18310523b6877e86b4e54df068a9ae5" From 15cdf579b26b6382ecb8c14708c94fdf3a9d98c7 Mon Sep 17 00:00:00 2001 From: benedettadavico Date: Thu, 10 Nov 2022 11:57:13 +0100 Subject: [PATCH 02/12] WIP --- .../test/pageobjects/authScreens.ts | 1 + .../test/specs/login/mnemoniclogin.spec.ts | 2 +- .../test/specs/login/passwordlogin.spec.ts | 79 +++++++++---------- nym-wallet/wallet-fe-tests/test/wdio.conf.ts | 76 +++++++++--------- 4 files changed, 77 insertions(+), 81 deletions(-) diff --git a/nym-wallet/wallet-fe-tests/test/pageobjects/authScreens.ts b/nym-wallet/wallet-fe-tests/test/pageobjects/authScreens.ts index 40ac1be09e..efdee9271a 100644 --- a/nym-wallet/wallet-fe-tests/test/pageobjects/authScreens.ts +++ b/nym-wallet/wallet-fe-tests/test/pageobjects/authScreens.ts @@ -16,6 +16,7 @@ class Auth { get mnemonicInput(): Promise { return $("[data-testid='inputMnemonic']") } get signIn(): Promise { return $("[data-testid='signInWithMnemonicButton']") } get backToSignInOptions(): Promise { return $("[data-testid='backToSignInOptions']") } + get revealMnemonic(): Promise { return $("[data-testid='Reveal Mnemonic']") } get createPassword(): Promise { return $("[data-testid='goToCreatePassword']") } // Create password step 1/2 diff --git a/nym-wallet/wallet-fe-tests/test/specs/login/mnemoniclogin.spec.ts b/nym-wallet/wallet-fe-tests/test/specs/login/mnemoniclogin.spec.ts index 5ca2e25205..1c19bcf85d 100644 --- a/nym-wallet/wallet-fe-tests/test/specs/login/mnemoniclogin.spec.ts +++ b/nym-wallet/wallet-fe-tests/test/specs/login/mnemoniclogin.spec.ts @@ -8,7 +8,7 @@ const Helper = require('../../../common/helper'); -describe.skip('Wallet sign in functionality with mnemonic', () => { +describe('Wallet sign in functionality with mnemonic', () => { it('get to the sign in with mnemonic screen', async () => { diff --git a/nym-wallet/wallet-fe-tests/test/specs/login/passwordlogin.spec.ts b/nym-wallet/wallet-fe-tests/test/specs/login/passwordlogin.spec.ts index d2c3ccafed..8e642c3d7a 100644 --- a/nym-wallet/wallet-fe-tests/test/specs/login/passwordlogin.spec.ts +++ b/nym-wallet/wallet-fe-tests/test/specs/login/passwordlogin.spec.ts @@ -39,70 +39,69 @@ describe('Create password for existing account and use it to sign in', () => { it('enter correct mnemonic', async () => { // generate random mnemonic in the backend - const randomMnemonic = ValidatorClient.randomMnemonic().toString; + const randomMnemonic = ValidatorClient.randomMnemonic(); deleteScript - console.log("THGARUHGHAGJAHG " + randomMnemonic) // use it to continue with password creation flow await Helper.navigateAndClick(Auth.backToMnemonicSignIn) await Helper.navigateAndClick(Auth.createPassword) await Helper.addValueToTextField(Auth.mnemonicInput, randomMnemonic) - await Helper.navigateAndClick(Auth.) + await Helper.navigateAndClick(Auth.revealMnemonic) await Helper.navigateAndClick(Auth.nextToPasswordCreation) await Helper.elementVisible(Auth.password) }) -// it('create an invalid password', async () => { + it('create an invalid password', async () => { -// // type an invalid password in both fields -// await Helper.addValueToTextField(Auth.password, textConstants.incorrectPassword) -// await Helper.navigateAndClick(Auth.confirmPassword) -// await Helper.addValueToTextField(Auth.confirmPassword, textConstants.incorrectPassword) -// // ensure the button to proceed is still disabled -// const nextButton = await Auth.createPasswordButton -// const isNextDisabled = await nextButton.getAttribute('disabled') -// expect(isNextDisabled).toBe("true") + // type an invalid password in both fields + await Helper.addValueToTextField(Auth.password, textConstants.incorrectPassword) + await Helper.navigateAndClick(Auth.confirmPassword) + await Helper.addValueToTextField(Auth.confirmPassword, textConstants.incorrectPassword) + // ensure the button to proceed is still disabled + const nextButton = await Auth.createPasswordButton + const isNextDisabled = await nextButton.getAttribute('disabled') + expect(isNextDisabled).toBe("true") -// }) + }) -// it('create a valid password', async () => { + it('create a valid password', async () => { -// // type a valid password in both fields -// await Helper.navigateAndClick(Auth.password) -// await Helper.addValueToTextField(Auth.password, textConstants.password) -// await Helper.navigateAndClick(Auth.confirmPassword) -// await Helper.addValueToTextField(Auth.confirmPassword, textConstants.password) -// // verify the password is created and the next screen is visible -// await Helper.navigateAndClick(Auth.createPasswordButton) -// await Helper.verifyStrictText(Auth.passwordLoginScreenHeader, textConstants.passwordSignIn) + // type a valid password in both fields + await Helper.navigateAndClick(Auth.password) + await Helper.addValueToTextField(Auth.password, textConstants.password) + await Helper.navigateAndClick(Auth.confirmPassword) + await Helper.addValueToTextField(Auth.confirmPassword, textConstants.password) + // verify the password is created and the next screen is visible + await Helper.navigateAndClick(Auth.createPasswordButton) + await Helper.verifyStrictText(Auth.passwordLoginScreenHeader, textConstants.passwordSignIn) -// }) + }) -// it('sign in with no password throws error', async () => { + it('sign in with no password throws error', async () => { -// //click sign without entering a password -// await Helper.navigateAndClick(Auth.signInPasswordButton) -// // wait for error -// await Helper.elementVisible(Auth.error) -// // verify error has the correct message -// await Helper.verifyStrictText(Auth.error, textConstants.signInWithoutPassword) + //click sign without entering a password + await Helper.navigateAndClick(Auth.signInPasswordButton) + // wait for error + await Helper.elementVisible(Auth.error) + // verify error has the correct message + await Helper.verifyStrictText(Auth.error, textConstants.signInWithoutPassword) -// }) + }) -// it('sign in with invalid password throws error', async () => { + it('sign in with invalid password throws error', async () => { -// // enter invalid password -// await Helper.addValueToTextField(Auth.enterPassword, textConstants.incorrectPassword) -// await Helper.navigateAndClick(Auth.signInPasswordButton) -// // wait for error -// await Helper.elementVisible(Auth.error) -// await Helper.verifyStrictText(Auth.error, textConstants.invalidPasswordOnSignIn) + // enter invalid password + await Helper.addValueToTextField(Auth.enterPassword, textConstants.incorrectPassword) + await Helper.navigateAndClick(Auth.signInPasswordButton) + // wait for error + await Helper.elementVisible(Auth.error) + await Helper.verifyStrictText(Auth.error, textConstants.invalidPasswordOnSignIn) -// }) + }) }) -describe.skip('Wallet sign in functionality without creating password', () => { +describe('Wallet sign in functionality without creating password', () => { it('sign in with invalid password and no saved wallet.json file throws error', async () => { diff --git a/nym-wallet/wallet-fe-tests/test/wdio.conf.ts b/nym-wallet/wallet-fe-tests/test/wdio.conf.ts index 2616587c97..5e62dc5b78 100644 --- a/nym-wallet/wallet-fe-tests/test/wdio.conf.ts +++ b/nym-wallet/wallet-fe-tests/test/wdio.conf.ts @@ -1,6 +1,7 @@ const os = require('os') const path = require('path') const { spawn, spawnSync } = require('child_process') + //insert path to binary const nym_path = '../target/debug/nym-wallet' @@ -17,26 +18,26 @@ exports.config = { specs: ['./test/specs/**/*.ts'], suites: { - // signup: [ - // './test/specs/signup/*.ts', - // ], + signup: [ + './test/specs/signup/*.ts', + ], login: [ './test/specs/login/*.ts', ], - // balance: [ - // './test/specs/balance/*.ts', - // ], - // nav: [ - // './test/specs/general/*.ts', - // ], - // send: [ - // './test/specs/send/*.ts', - // ], - // delegation: [ - // './test/specs/delegation/*.ts', - // ], + balance: [ + './test/specs/balance/*.ts', + ], + nav: [ + './test/specs/general/*.ts', + ], + send: [ + './test/specs/bond/*.ts', + ], + delegation: [ + './test/specs/delegation/*.ts', + ], }, - // Patterns to exclude. + exclude: [ // 'path/to/excluded/files' ], @@ -49,12 +50,11 @@ exports.config = { }, }, ], - // + // =================== // Test Configurations // =================== - // Define all options that are relevant for the WebdriverIO instance here - // + // Level of logging verbosity: trace | debug | info | warn | error | silent logLevel: 'error', bail: 0, @@ -64,29 +64,26 @@ exports.config = { ui: 'bdd', timeout: 60000, }, - // =================== - // Test Reporters - // =================== - reporters: [ - [ - "allure", - { - outputDir: "allure-results", - disableWebdriverStepsReporting: true, - disableWebdriverScreenshotsReporting: true, - }, - ], - ], - // this is documentented in the readme - you will need to build the project first - // ensure the rust project is built since we expect this binary to exist for the webdriver sessions + // Reporting tool and settings - // ensure we are running `tauri-driver` before the session starts so that we can proxy the webdriver requests + // reporters: [ + // [ + // "allure", + // { + // outputDir: "allure-results", + // disableWebdriverStepsReporting: true, + // disableWebdriverScreenshotsReporting: true, + // }, + // ], + // ], - onPrepare: () => { - let scriptpath = process.cwd() + "/scripts/killprocess.sh"; - spawn('bash', [scriptpath]); - }, + // Things to run before/after each test session + + // onPrepare: () => { + // let scriptpath = process.cwd() + "/scripts/killprocess.sh"; + // spawn('bash', [scriptpath]); + // }, beforeSession: () => { @@ -99,7 +96,6 @@ exports.config = { }, - // clean up the `tauri-driver` process we spawned at the start of the session afterSession: () => tauriDriver.kill(), From aa5cbd06d45bb601f912b398e0797524e58d4e09 Mon Sep 17 00:00:00 2001 From: benedettadavico Date: Thu, 10 Nov 2022 11:58:08 +0100 Subject: [PATCH 03/12] WIP --- nym-wallet/src/components/textfields.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nym-wallet/src/components/textfields.tsx b/nym-wallet/src/components/textfields.tsx index f48b5e6b8f..2879b07d83 100644 --- a/nym-wallet/src/components/textfields.tsx +++ b/nym-wallet/src/components/textfields.tsx @@ -35,6 +35,7 @@ export const MnemonicInput: React.FC<{ }} /> setShowPassword((show) => !show)} />} label="Reveal my mnemonic" /> @@ -74,6 +75,9 @@ export const PasswordInput: React.FC<{ ), }} InputLabelProps={{ shrink: true }} + inputProps={{ + "data-testid": label, + }} /> {error && } From bc79ee0cad6f48b17fcc89359671405e8198377e Mon Sep 17 00:00:00 2001 From: benedettadavico Date: Thu, 10 Nov 2022 18:29:16 +0100 Subject: [PATCH 04/12] WIP --- nym-wallet/wallet-fe-tests/common/helper.ts | 13 +++- .../wallet-fe-tests/common/text-constants.ts | 2 +- .../wallet-fe-tests/common/user-data.json | 10 +-- nym-wallet/wallet-fe-tests/package.json | 3 +- .../test/specs/general/navbaritems.spec.ts | 14 +++- .../test/specs/login/mnemoniclogin.spec.ts | 7 +- .../test/specs/login/passwordlogin.spec.ts | 2 +- nym-wallet/wallet-fe-tests/test/wdio.conf.ts | 73 ++++++++++--------- 8 files changed, 71 insertions(+), 53 deletions(-) diff --git a/nym-wallet/wallet-fe-tests/common/helper.ts b/nym-wallet/wallet-fe-tests/common/helper.ts index 1de3c8798d..e1372a3760 100644 --- a/nym-wallet/wallet-fe-tests/common/helper.ts +++ b/nym-wallet/wallet-fe-tests/common/helper.ts @@ -15,17 +15,19 @@ class Helpers { await Balance.selectQa() } + // login with a mnemonic loginMnemonic = async () => { await Auth.loginWithMnemonic(userData.mnemonic) } - //helper to decode mnemonic so plain 24 character passphrase isn't in sight albeit it is presented when ruunning the scripts - // TO-DO figure out what's going on with the decoding bit + // decode user data file decodeBase = async (input) => { var m = Buffer.from(input, "base64").toString(); return m; } + // common actions + navigateAndClick = async (element) => { await element.waitForClickable({ timeout: 6000 }) await element.click(); @@ -54,11 +56,16 @@ class Helpers { expect(error).toContain(expectedText) } + // wait = async () => { + // await browser.pause(9000) + + // } + + // token calculations currentBalance = async (value) => { return parseFloat(value.split(/\s+/)[0].toString()).toFixed(5) } - calculateFees = async (beforeBalance, transactionFee, amount, isSend) => { let fee diff --git a/nym-wallet/wallet-fe-tests/common/text-constants.ts b/nym-wallet/wallet-fe-tests/common/text-constants.ts index 8ac7854773..33db1d8347 100644 --- a/nym-wallet/wallet-fe-tests/common/text-constants.ts +++ b/nym-wallet/wallet-fe-tests/common/text-constants.ts @@ -35,7 +35,7 @@ module.exports = { version: "1.2.1", // user incorrect data - incorrectMnemonic: "giraffe note order sun cradle bottom crime humble able antique rural donkey guess parent potato tongue truly way disagree exile zebra someone else heat", + incorrectMnemonic: "bottom crime humble able antique rural donkey guess parent potato tongue truly way disagree exile zebra someone else heat giraffe note order sun cradle", randomString:"thisrandomstring", password:"iAmThePassword1!", incorrectPassword:"123notvalid", diff --git a/nym-wallet/wallet-fe-tests/common/user-data.json b/nym-wallet/wallet-fe-tests/common/user-data.json index 7764ce25bb..008c91a317 100644 --- a/nym-wallet/wallet-fe-tests/common/user-data.json +++ b/nym-wallet/wallet-fe-tests/common/user-data.json @@ -1,10 +1,4 @@ { - "mnemonic": "giraffe note order sun cradle bottom crime humble able antique rural donkey guess parent potato tongue truly way disagree exile zebra someone else typical", - "qa_address": "n1qqct7gs79yrjncpkumljxeqjsnwvn42j2g3fw4", - "receiver_address": "n167rupnmpput2alw62sz43eelks03zek4fwvjk0", - "amount_to_send": "1", - "identity_key_to_delegate_mix_node": "HqW2HStFHtAZ3PxRaiSCh7xJK6B7swoR1gSmJzH2iV9g", - "identity_key_to_delegate_gateway": "", - "delegate_amount": "10" - } + "mnemonic": "Y2FsbCBub2JsZSBhdWN0aW9uIHNhdGlzZnkgZHVzdCBzdWRkZW4gbWF0aCBsb2FuIHVzdWFsIHBpenphIG95c3RlciBkd2FyZiB2ZXNzZWwgZm9vdCBuZXh0IGFnZSBsaW5rIHN0b29sIGZsdWlkIGxpemFyZCBzaHkgaGVuIHNlY3VyaXR5IHllbGxvdw==" +} \ No newline at end of file diff --git a/nym-wallet/wallet-fe-tests/package.json b/nym-wallet/wallet-fe-tests/package.json index e9ca397e2a..cdff22eafd 100644 --- a/nym-wallet/wallet-fe-tests/package.json +++ b/nym-wallet/wallet-fe-tests/package.json @@ -18,6 +18,7 @@ }, "scripts": { "test": "wdio run test/wdio.conf.ts", - "test-login": "wdio run test/wdio.conf.ts --suite login" + "test-login": "wdio run test/wdio.conf.ts --suite login", + "test-general": "wdio run test/wdio.conf.ts --suite general" } } diff --git a/nym-wallet/wallet-fe-tests/test/specs/general/navbaritems.spec.ts b/nym-wallet/wallet-fe-tests/test/specs/general/navbaritems.spec.ts index 8d8443a4ef..dbea26c381 100644 --- a/nym-wallet/wallet-fe-tests/test/specs/general/navbaritems.spec.ts +++ b/nym-wallet/wallet-fe-tests/test/specs/general/navbaritems.spec.ts @@ -5,15 +5,23 @@ import Send from '../../pageobjects/sendScreen' import Receive from '../../pageobjects/receiveScreen' import Bond from '../../pageobjects/bondScreen' import Delegation from '../../pageobjects/delegationScreen' -const userData = require("../../common/user-data.json"); -const Helper = require('../../common/helper'); +const userData = require("../../../common/user-data.json"); +const Helper = require('../../../common/helper'); describe('Nav Items behave correctly', () => { it('switch from light to dark mode and back', async () => { - //log in + //log in() + const test = await Helper.decodeBase(userData.mnemonic); + console.log("---------------------------"); + console.log(test); + console.log("---------------------------"); + console.log("---------------------------"); + + + await Helper.freshMnemonicLoginQaNetwork() // click on different modes await Helper.navigateAndClick(Nav.lightMode) diff --git a/nym-wallet/wallet-fe-tests/test/specs/login/mnemoniclogin.spec.ts b/nym-wallet/wallet-fe-tests/test/specs/login/mnemoniclogin.spec.ts index 1c19bcf85d..67cd0c34fa 100644 --- a/nym-wallet/wallet-fe-tests/test/specs/login/mnemoniclogin.spec.ts +++ b/nym-wallet/wallet-fe-tests/test/specs/login/mnemoniclogin.spec.ts @@ -1,7 +1,6 @@ import Auth from '../../pageobjects/authScreens' import Balance from '../../pageobjects/balanceScreen' import ValidatorClient from '@nymproject/nym-validator-client'; -import { text } from 'stream/consumers'; const textConstants = require("../../../common/text-constants"); const userData = require("../../../common/user-data.json"); const Helper = require('../../../common/helper'); @@ -33,6 +32,7 @@ describe('Wallet sign in functionality with mnemonic', () => { it('sign in with incorrect mnemonic throws error', async () => { // enter an incorrect mnemonic string + await Helper.navigateAndClick(Auth.revealMnemonic) await Helper.addValueToTextField(Auth.mnemonicInput, textConstants.incorrectMnemonic) await Helper.navigateAndClick(Auth.signIn) // verifty error message is correct @@ -42,6 +42,7 @@ describe('Wallet sign in functionality with mnemonic', () => { it('sign in with random string throws error', async () => { + await Helper.navigateAndClick(Auth.revealMnemonic) // enter a random string not in mnemonic "format" await Helper.addValueToTextField(Auth.mnemonicInput, textConstants.randomString) await Helper.navigateAndClick(Auth.signIn) @@ -55,12 +56,12 @@ describe('Wallet sign in functionality with mnemonic', () => { // create new mnemonic const randomMnemonic = ValidatorClient.randomMnemonic(); // enter mnemonic + await Helper.navigateAndClick(Auth.revealMnemonic) await Helper.addValueToTextField(Auth.mnemonicInput, randomMnemonic) await Helper.navigateAndClick(Auth.signIn) // verify successful login, balance is visible await Helper.elementVisible(Balance.balance) - //new accounts will always default to mainnet, so 0 balance - // TO-DO this value sometimes returns " " instead of "0" + // TO-DO this value below is sometimes returning "" await Helper.verifyStrictText(Balance.nymBalance, textConstants.noNym) }) diff --git a/nym-wallet/wallet-fe-tests/test/specs/login/passwordlogin.spec.ts b/nym-wallet/wallet-fe-tests/test/specs/login/passwordlogin.spec.ts index 8e642c3d7a..fc0b5987d5 100644 --- a/nym-wallet/wallet-fe-tests/test/specs/login/passwordlogin.spec.ts +++ b/nym-wallet/wallet-fe-tests/test/specs/login/passwordlogin.spec.ts @@ -44,8 +44,8 @@ describe('Create password for existing account and use it to sign in', () => { // use it to continue with password creation flow await Helper.navigateAndClick(Auth.backToMnemonicSignIn) await Helper.navigateAndClick(Auth.createPassword) - await Helper.addValueToTextField(Auth.mnemonicInput, randomMnemonic) await Helper.navigateAndClick(Auth.revealMnemonic) + await Helper.addValueToTextField(Auth.mnemonicInput, randomMnemonic) await Helper.navigateAndClick(Auth.nextToPasswordCreation) await Helper.elementVisible(Auth.password) }) diff --git a/nym-wallet/wallet-fe-tests/test/wdio.conf.ts b/nym-wallet/wallet-fe-tests/test/wdio.conf.ts index 5e62dc5b78..716da9cac5 100644 --- a/nym-wallet/wallet-fe-tests/test/wdio.conf.ts +++ b/nym-wallet/wallet-fe-tests/test/wdio.conf.ts @@ -3,7 +3,7 @@ const path = require('path') const { spawn, spawnSync } = require('child_process') //insert path to binary -const nym_path = '../target/debug/nym-wallet' +const nym_path = '../target/release/nym-wallet' let tauriDriver: any @@ -18,24 +18,24 @@ exports.config = { specs: ['./test/specs/**/*.ts'], suites: { - signup: [ - './test/specs/signup/*.ts', - ], + signup: [ + './test/specs/signup/*.ts', + ], login: [ './test/specs/login/*.ts', ], - balance: [ - './test/specs/balance/*.ts', - ], - nav: [ - './test/specs/general/*.ts', - ], - send: [ - './test/specs/bond/*.ts', - ], - delegation: [ - './test/specs/delegation/*.ts', - ], + balance: [ + './test/specs/balance/*.ts', + ], + general: [ + './test/specs/general/*.ts', + ], + send: [ + './test/specs/bond/*.ts', + ], + delegation: [ + './test/specs/delegation/*.ts', + ], }, exclude: [ @@ -50,16 +50,16 @@ exports.config = { }, }, ], - + // =================== // Test Configurations // =================== - + // Level of logging verbosity: trace | debug | info | warn | error | silent logLevel: 'error', bail: 0, framework: 'mocha', - // reporters: ['spec'], + // reporters: ['spec'], mochaOpts: { ui: 'bdd', timeout: 60000, @@ -67,23 +67,25 @@ exports.config = { // Reporting tool and settings - // reporters: [ - // [ - // "allure", - // { - // outputDir: "allure-results", - // disableWebdriverStepsReporting: true, - // disableWebdriverScreenshotsReporting: true, - // }, - // ], - // ], + reporters: [ + [ + "allure", + { + outputDir: "allure-results", + disableWebdriverStepsReporting: true, + disableWebdriverScreenshotsReporting: true, + // useCucumberStepReporter: true, + // disableMochaHooks: true, + }, + ], + ], // Things to run before/after each test session - // onPrepare: () => { - // let scriptpath = process.cwd() + "/scripts/killprocess.sh"; - // spawn('bash', [scriptpath]); - // }, + onPrepare: () => { + let scriptpath = process.cwd() + "/scripts/killprocess.sh"; + spawn('bash', [scriptpath]); + }, beforeSession: () => { @@ -96,6 +98,11 @@ exports.config = { }, + // afterEach: function(test) { + // if (test.error !== undefined) { + // browser.takeScreenshot();} + // }, + // clean up the `tauri-driver` process we spawned at the start of the session afterSession: () => tauriDriver.kill(), From 452e9ed637b56570d68c51db29f7eb7a18e1e702 Mon Sep 17 00:00:00 2001 From: benedettadavico Date: Fri, 11 Nov 2022 17:44:03 +0100 Subject: [PATCH 05/12] WIP; debugging issues --- nym-wallet/src/components/Mnemonic.tsx | 7 ++-- nym-wallet/src/components/Nav.tsx | 1 + nym-wallet/src/components/NetworkSelector.tsx | 3 +- nym-wallet/src/pages/balance/balance.tsx | 2 +- nym-wallet/wallet-fe-tests/common/helper.ts | 12 ++++--- .../wallet-fe-tests/common/text-constants.ts | 2 +- nym-wallet/wallet-fe-tests/package.json | 5 ++- .../test/pageobjects/authScreens.ts | 15 +++++--- .../test/pageobjects/balanceScreen.ts | 4 +-- .../test/specs/general/navbaritems.spec.ts | 8 ----- .../test/specs/signup/newaccount.spec.ts | 27 +++++++++++--- nym-wallet/wallet-fe-tests/test/wdio.conf.ts | 36 ++++++++++--------- 12 files changed, 75 insertions(+), 47 deletions(-) diff --git a/nym-wallet/src/components/Mnemonic.tsx b/nym-wallet/src/components/Mnemonic.tsx index d445172e9a..fce87e38f1 100644 --- a/nym-wallet/src/components/Mnemonic.tsx +++ b/nym-wallet/src/components/Mnemonic.tsx @@ -2,6 +2,7 @@ import React from 'react'; import { Button, Stack, TextField, Typography } from '@mui/material'; import { Check, ContentCopySharp } from '@mui/icons-material'; import { Warning } from './Warning'; +import { MnemonicModal } from './Accounts/modals/MnemonicModal'; export const Mnemonic = ({ mnemonic, @@ -14,18 +15,19 @@ export const Mnemonic = ({ }) => ( - + Below is your 24 word mnemonic, make sure to store it in a safe place for accessing your wallet in the future