diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index 65aacd0..ce7f7a1 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -19,60 +19,107 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout code + - name: Checkout code 🛎️ uses: actions/checkout@v3 - - name: Install Node.js + - name: Install Node.js 📚 uses: actions/setup-node@v3 with: node-version: 18 - # TODO: Caches not working properly as of now. Debug it later - - name: Cache node modules - id: cache-npm - uses: actions/cache@v3 - env: - cache-name: cache-node-modules - with: - # npm cache files are stored in `~/.npm` on Linux/macOS - path: ~/.npm - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - - if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} - name: List the state of node modules - continue-on-error: true - run: npm list - - - name: Install dependencies + - name: Install dependencies 📚 run: npm ci - - name: Install Playwright Browsers + - name: Install Playwright Browsers 📚 run: npx playwright install --with-deps - name: TC01 - Run Playwright tests run: npm run test:tc01 env: WEBAPP_URL: ${{ vars.WEBAPP_URL }} + BROWSER: chromium - name: TC01 - Deploy Report for TC 01🚀 uses: JamesIves/github-pages-deploy-action@v4 with: branch: gh-pages - folder: playwright-report # The folder the action should deploy. - target-folder: tests/tc-01/ + folder: playwright-report + target-folder: tests/pr-05/tc-01/ + + - name: TC02 - Run Playwright tests + run: npm run test:tc02 + env: + WEBAPP_URL: ${{ vars.WEBAPP_URL }} + BROWSER: chromium + + - name: TC02 - Deploy Report for TC 02🚀 + uses: JamesIves/github-pages-deploy-action@v4 + with: + branch: gh-pages + folder: playwright-report + target-folder: tests/pr-05/tc-02/ + + - name: TC03 - Run Playwright tests + run: npm run test:tc03 + env: + WEBAPP_URL: ${{ vars.WEBAPP_URL }} + BROWSER: chromium + + - name: TC03 - Deploy Report for TC 03🚀 + uses: JamesIves/github-pages-deploy-action@v4 + with: + branch: gh-pages + folder: playwright-report + target-folder: tests/pr-05/tc-03/ - name: TC04 - Run Playwright tests run: npm run test:tc04 env: WEBAPP_URL: ${{ vars.WEBAPP_URL }} + BROWSER: chromium - name: TC04 - Deploy Report for TC 04🚀 uses: JamesIves/github-pages-deploy-action@v4 with: branch: gh-pages - folder: playwright-report # The folder the action should deploy. - target-folder: tests/pr-01/tc-04/ \ No newline at end of file + folder: playwright-report + target-folder: tests/pr-05/tc-04/ + + - name: TC05 - Run Playwright tests + run: npm run test:tc05 + env: + WEBAPP_URL: ${{ vars.WEBAPP_URL }} + BROWSER: chromium + + - name: TC05 - Deploy Report for TC 05🚀 + uses: JamesIves/github-pages-deploy-action@v4 + with: + branch: gh-pages + folder: playwright-report + target-folder: tests/pr-05/tc-05/ + + - name: TC06 - Run Playwright tests + run: npm run test:tc06 + env: + WEBAPP_URL: ${{ vars.WEBAPP_URL }} + BROWSER: chromium + + - name: TC06 - Deploy Report for TC 06🚀 + uses: JamesIves/github-pages-deploy-action@v4 + with: + branch: gh-pages + folder: playwright-report + target-folder: tests/pr-05/tc-06/ + + - name: TC07 - Run Playwright tests + run: npm run test:tc07 + env: + WEBAPP_URL: ${{ vars.WEBAPP_URL }} + BROWSER: chromium + + - name: TC07 - Deploy Report for TC 07🚀 + uses: JamesIves/github-pages-deploy-action@v4 + with: + branch: gh-pages + folder: playwright-report + target-folder: tests/pr-05/tc-07/ \ No newline at end of file diff --git a/TestData/hd-wallet.tez b/TestData/hd-wallet.tez deleted file mode 100644 index 7c78d40..0000000 --- a/TestData/hd-wallet.tez +++ /dev/null @@ -1,8 +0,0 @@ -{ - "provider": "Kukai", - "version": 3, - "walletType": 4, - "encryptedSeed": "abaa113b9d4430083b66337fba7bf82b2dfebc0314cdce0a123c24648791402ed94fe669fe76b897f6bbcba2326caac8f112b714daac9440a42a8943f7691b73==e9b2eda04a575492249a5714fffcfb71", - "encryptedEntropy": "a4125f854cd63c2f639bd75924aac346477e401c6f4a4ae205409f6303e18ccd==c9cda4c8818a15921ae1f4c160857f40", - "iv": "2ec78914461a8ac254fab9ba0416fbb0" -} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index ef1757a..8ea6430 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "1.0.0", "license": "ISC", "dependencies": { + "@taquito/taquito": "^17.3.0", "aws-sdk": "^2.1419.0", "dotenv": "^16.3.1" }, @@ -48,11 +49,234 @@ "node": ">=16" } }, + "node_modules/@stablelib/binary": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/binary/-/binary-1.0.1.tgz", + "integrity": "sha512-ClJWvmL6UBM/wjkvv/7m5VP3GMr9t0osr4yVgLZsLCOz4hGN9gIAFEqnJ0TsSMAN+n840nf2cHZnA5/KFqHC7Q==", + "dependencies": { + "@stablelib/int": "^1.0.1" + } + }, + "node_modules/@stablelib/blake2b": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/blake2b/-/blake2b-1.0.1.tgz", + "integrity": "sha512-B3KyKoBAjkIFeH7romcF96i+pVFYk7K2SBQ1pZvaxV+epSBXJ+n0C66esUhyz6FF+5FbdQVm77C5fzGFcEZpKA==", + "dependencies": { + "@stablelib/binary": "^1.0.1", + "@stablelib/hash": "^1.0.1", + "@stablelib/wipe": "^1.0.1" + } + }, + "node_modules/@stablelib/ed25519": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@stablelib/ed25519/-/ed25519-1.0.3.tgz", + "integrity": "sha512-puIMWaX9QlRsbhxfDc5i+mNPMY+0TmQEskunY1rZEBPi1acBCVQAhnsk/1Hk50DGPtVsZtAWQg4NHGlVaO9Hqg==", + "dependencies": { + "@stablelib/random": "^1.0.2", + "@stablelib/sha512": "^1.0.1", + "@stablelib/wipe": "^1.0.1" + } + }, + "node_modules/@stablelib/hash": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/hash/-/hash-1.0.1.tgz", + "integrity": "sha512-eTPJc/stDkdtOcrNMZ6mcMK1e6yBbqRBaNW55XA1jU8w/7QdnCF0CmMmOD1m7VSkBR44PWrMHU2l6r8YEQHMgg==" + }, + "node_modules/@stablelib/int": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/int/-/int-1.0.1.tgz", + "integrity": "sha512-byr69X/sDtDiIjIV6m4roLVWnNNlRGzsvxw+agj8CIEazqWGOQp2dTYgQhtyVXV9wpO6WyXRQUzLV/JRNumT2w==" + }, + "node_modules/@stablelib/random": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@stablelib/random/-/random-1.0.2.tgz", + "integrity": "sha512-rIsE83Xpb7clHPVRlBj8qNe5L8ISQOzjghYQm/dZ7VaM2KHYwMW5adjQjrzTZCchFnNCNhkwtnOBa9HTMJCI8w==", + "dependencies": { + "@stablelib/binary": "^1.0.1", + "@stablelib/wipe": "^1.0.1" + } + }, + "node_modules/@stablelib/sha512": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/sha512/-/sha512-1.0.1.tgz", + "integrity": "sha512-13gl/iawHV9zvDKciLo1fQ8Bgn2Pvf7OV6amaRVKiq3pjQ3UmEpXxWiAfV8tYjUpeZroBxtyrwtdooQT/i3hzw==", + "dependencies": { + "@stablelib/binary": "^1.0.1", + "@stablelib/hash": "^1.0.1", + "@stablelib/wipe": "^1.0.1" + } + }, + "node_modules/@stablelib/wipe": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/wipe/-/wipe-1.0.1.tgz", + "integrity": "sha512-WfqfX/eXGiAd3RJe4VU2snh/ZPwtSjLG4ynQ/vYzvghTh7dHFcI1wl+nrkWG6lGhukOxOsUHfv8dUXr58D0ayg==" + }, + "node_modules/@taquito/core": { + "version": "17.3.0", + "resolved": "https://registry.npmjs.org/@taquito/core/-/core-17.3.0.tgz", + "integrity": "sha512-worh4CMAue4GqLZeJOB1PwIHZ+LH+RmHxfRuSD/c0VoAbuJUVkdRu+uLgGyx+hdIKUeyAxe2g41c50VSMYF3Zw==", + "engines": { + "node": ">=16" + } + }, + "node_modules/@taquito/http-utils": { + "version": "17.3.0", + "resolved": "https://registry.npmjs.org/@taquito/http-utils/-/http-utils-17.3.0.tgz", + "integrity": "sha512-jUclvXppsIExn93PSrEsW5IkrsP11V9D5DWfqFne5uwt5GAaJBlaSYBJKo4vyfE9EGmZ+MQWs0X/MbTT625FgA==", + "dependencies": { + "@taquito/core": "^17.3.0", + "axios": "0.26.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@taquito/local-forging": { + "version": "17.3.0", + "resolved": "https://registry.npmjs.org/@taquito/local-forging/-/local-forging-17.3.0.tgz", + "integrity": "sha512-Y/4Yl2RBvE7UhgZ1GNj6LlJFgfqtgtNNbZ9zJEqbUBuxpwC/i0ZP5UlOwInbwFS9081vrWgLkj3JNyvC7KP2Kg==", + "dependencies": { + "@taquito/core": "^17.3.0", + "@taquito/utils": "^17.3.0", + "bignumber.js": "^9.1.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@taquito/michel-codec": { + "version": "17.3.0", + "resolved": "https://registry.npmjs.org/@taquito/michel-codec/-/michel-codec-17.3.0.tgz", + "integrity": "sha512-svct6iY1VnwFUlJaj6LX6kcuTqQ0nCiZ+DcTmsZAG6HcCP3gcEPxf02pbZl2zyqJbNpeKt4Q9EDaxBapBW2G5Q==", + "dependencies": { + "@taquito/core": "^17.3.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@taquito/michelson-encoder": { + "version": "17.3.0", + "resolved": "https://registry.npmjs.org/@taquito/michelson-encoder/-/michelson-encoder-17.3.0.tgz", + "integrity": "sha512-XFvAGdnwpH0TF8liNiuE5COdvBFh5VmyN8WullRvwxlUcxLvQYS+MAfJjbk7WuSv4k31gQPc9r7O3G4m0AbPlA==", + "dependencies": { + "@taquito/rpc": "^17.3.0", + "@taquito/utils": "^17.3.0", + "bignumber.js": "^9.1.0", + "fast-json-stable-stringify": "^2.1.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@taquito/rpc": { + "version": "17.3.0", + "resolved": "https://registry.npmjs.org/@taquito/rpc/-/rpc-17.3.0.tgz", + "integrity": "sha512-xZkTS3BhAe/9Bo8Q7o5LLsMYkv5R+g33gp2Fm/drmpyFmepk1QCj94fEvIUSb/7CcOJxr3dnPXTPh1hpi8zp+w==", + "dependencies": { + "@taquito/core": "^17.3.0", + "@taquito/http-utils": "^17.3.0", + "@taquito/utils": "^17.3.0", + "bignumber.js": "^9.1.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@taquito/taquito": { + "version": "17.3.0", + "resolved": "https://registry.npmjs.org/@taquito/taquito/-/taquito-17.3.0.tgz", + "integrity": "sha512-AODy23a398LWx2k7gIFxHrJHe8BzLsvxCBR9eTIOH1qhhCiKf9oEEJR6Ymj9rAXnp3RoZRt/orQ7ylqB0NrXnA==", + "hasInstallScript": true, + "dependencies": { + "@taquito/core": "^17.3.0", + "@taquito/http-utils": "^17.3.0", + "@taquito/local-forging": "^17.3.0", + "@taquito/michel-codec": "^17.3.0", + "@taquito/michelson-encoder": "^17.3.0", + "@taquito/rpc": "^17.3.0", + "@taquito/utils": "^17.3.0", + "bignumber.js": "^9.1.0", + "rxjs": "^7.8.1" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@taquito/utils": { + "version": "17.3.0", + "resolved": "https://registry.npmjs.org/@taquito/utils/-/utils-17.3.0.tgz", + "integrity": "sha512-e1MdHDdDcK473bdi/zLtBV91b/7SUx/j0kwKXgPt04hbKX+/Nu1mJSviExFE/GXgxFvB6iufDui45Ui8jcYKtg==", + "dependencies": { + "@stablelib/blake2b": "^1.0.1", + "@stablelib/ed25519": "^1.0.3", + "@taquito/core": "^17.3.0", + "@types/bs58check": "^2.1.0", + "bignumber.js": "^9.1.0", + "blakejs": "^1.2.1", + "bs58check": "^2.1.2", + "buffer": "^6.0.3", + "elliptic": "^6.5.4", + "typedarray-to-buffer": "^4.0.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@taquito/utils/node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/@taquito/utils/node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/@types/bs58check": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/bs58check/-/bs58check-2.1.0.tgz", + "integrity": "sha512-OxsysnJQh82vy9DRbOcw9m2j/WiyqZLn0YBhKxdQ+aCwoHj+tWzyCgpwAkr79IfDXZKxc6h7k89T9pwS78CqTQ==", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/node": { "version": "20.4.0", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.4.0.tgz", - "integrity": "sha512-jfT7iTf/4kOQ9S7CHV9BIyRaQqHu67mOjsIQBC3BKZvzvUB6zLxEwJ6sBE3ozcvP8kF6Uk5PXN0Q+c0dfhGX0g==", - "dev": true + "integrity": "sha512-jfT7iTf/4kOQ9S7CHV9BIyRaQqHu67mOjsIQBC3BKZvzvUB6zLxEwJ6sBE3ozcvP8kF6Uk5PXN0Q+c0dfhGX0g==" }, "node_modules/available-typed-arrays": { "version": "1.0.5", @@ -85,6 +309,22 @@ "node": ">= 10.0.0" } }, + "node_modules/axios": { + "version": "0.26.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.26.0.tgz", + "integrity": "sha512-lKoGLMYtHvFrPVt3r+RBMp9nh34N0M8zEfCWqdWZx6phynIEhQqAdydpyBAAG211zlhX9Rgu08cOamy6XjE5Og==", + "dependencies": { + "follow-redirects": "^1.14.8" + } + }, + "node_modules/base-x": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.9.tgz", + "integrity": "sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ==", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, "node_modules/base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", @@ -104,6 +344,47 @@ } ] }, + "node_modules/bignumber.js": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", + "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==", + "engines": { + "node": "*" + } + }, + "node_modules/blakejs": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.2.1.tgz", + "integrity": "sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==" + }, + "node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, + "node_modules/brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==" + }, + "node_modules/bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", + "dependencies": { + "base-x": "^3.0.2" + } + }, + "node_modules/bs58check": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", + "integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==", + "dependencies": { + "bs58": "^4.0.0", + "create-hash": "^1.1.0", + "safe-buffer": "^5.1.2" + } + }, "node_modules/buffer": { "version": "4.9.2", "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", @@ -126,6 +407,27 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dependencies": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, "node_modules/dotenv": { "version": "16.3.1", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", @@ -137,6 +439,20 @@ "url": "https://github.com/motdotla/dotenv?sponsor=1" } }, + "node_modules/elliptic": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "dependencies": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + } + }, "node_modules/events": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", @@ -145,6 +461,30 @@ "node": ">=0.4.x" } }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + }, + "node_modules/follow-redirects": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, "node_modules/for-each": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", @@ -244,6 +584,38 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/hash-base": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "dependencies": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dependencies": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "node_modules/hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", + "dependencies": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, "node_modules/ieee754": { "version": "1.1.13", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", @@ -321,6 +693,26 @@ "node": ">= 0.6.0" } }, + "node_modules/md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" + }, + "node_modules/minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==" + }, "node_modules/playwright": { "version": "1.35.1", "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.35.1.tgz", @@ -363,11 +755,104 @@ "node": ">=0.4.x" } }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "node_modules/rxjs": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", + "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/sax": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.1.tgz", "integrity": "sha512-8I2a3LovHTOpm7NV5yOyO8IHqgVsfK4+UuySrXU8YXkSRX7k6hCV9b3HrkKCr3nMpgj+0bmocaJJWpvp1oc7ZA==" }, + "node_modules/sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + }, + "bin": { + "sha.js": "bin.js" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + }, + "node_modules/typedarray-to-buffer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-4.0.0.tgz", + "integrity": "sha512-6dOYeZfS3O9RtRD1caom0sMxgK59b27+IwoNy8RDPsmslSGOyU+mpTamlaIW7aNKi90ZQZ9DFaZL3YRoiSCULQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/url": { "version": "0.10.3", "resolved": "https://registry.npmjs.org/url/-/url-0.10.3.tgz", @@ -389,6 +874,11 @@ "which-typed-array": "^1.1.2" } }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, "node_modules/uuid": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.0.0.tgz", diff --git a/package.json b/package.json index 41a6e44..41e8650 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,8 @@ "test:tc03": "playwright test tests/TC03", "test:tc04": "playwright test tests/TC04", "test:tc05": "playwright test tests/TC05", + "test:tc06": "playwright test tests/TC06", + "test:tc07": "playwright test tests/TC07", "dev": "node --inspect-brk ./node_modules/@playwright/test/cli.js test TC04DAOValues.spec.js --project=chromium --headed" }, "keywords": [], @@ -20,6 +22,7 @@ "playwright": "^1.35.1" }, "dependencies": { + "@taquito/taquito": "^17.3.0", "aws-sdk": "^2.1419.0", "dotenv": "^16.3.1" }, diff --git a/playwright.config.js b/playwright.config.js index b15af2e..d4af5fb 100644 --- a/playwright.config.js +++ b/playwright.config.js @@ -19,7 +19,8 @@ module.exports = defineConfig({ /* Retry on CI only */ retries: process.env.CI ? 2 : 0, /* Opt out of parallel tests on CI. */ - workers: process.env.CI ? 1 : undefined, + workers: 1 , + // workers: process.env.CI ? 1 : undefined, /* Reporter to use. See https://playwright.dev/docs/test-reporters */ reporter: 'html', /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ @@ -38,16 +39,6 @@ module.exports = defineConfig({ use: { ...devices['Desktop Chrome'] }, }, - { - name: 'firefox', - use: { ...devices['Desktop Firefox'] }, - }, - - { - name: 'webkit', - use: { ...devices['Desktop Safari'] }, - }, - /* Test against mobile viewports. */ // { // name: 'Mobile Chrome', diff --git a/tests/CommonFile/Locator.js b/tests/CommonFile/Locator.js index efcd672..b25dd8f 100644 --- a/tests/CommonFile/Locator.js +++ b/tests/CommonFile/Locator.js @@ -1,8 +1,9 @@ -const pageLocators = { +import { DAONam } from "./TestData"; +const pageLocators = { TokenCreator: { - MainNet:"//p[text()='Mainnet']", - GhostNet:"//h6[text()='Ghostnet']", + MainNet: "//p[text()='Mainnet']", + GhostNet: "//h6[text()='Ghostnet']", EnterApp: ".MuiButtonBase-root.MuiButton-root.MuiButton-contained.jss11.jss12.MuiButton-containedSecondary", frame: "div.MuiGrid-root.MuiGrid-container.MuiGrid-align-items-xs-center.MuiGrid-justify-content-xs-center", ConnectWallet: "//span[text()='Connect Wallet']", @@ -20,7 +21,7 @@ const pageLocators = { ContinueButton2: "//p[text()='Continue']", launch: "//p[text()='Launch']", DeployText: "Governance token successfully deployed", - ConsoleAddress: "p[class='MuiTypography-root-165 MuiTypography-body1-167 MuiTypography-colorTextSecondary-191']", + ConsoleAddress: "//p[@class='MuiTypography-root-165 MuiTypography-body1-167 MuiTypography-colorTextSecondary-191']", ErrorText: "Required", }, @@ -44,16 +45,16 @@ const pageLocators = { ThresholdExpiryDays: "//input[@name='proposalExpiryBlocksDay']", ThresholdExpiryHours: "//input[@name='proposalExpiryBlocksHours']", ThresholdExpiryMinutes: "//input[@name='proposalExpiryBlocksMinutes']", - Slider:"span[role='slider']", + Slider: "span[role='slider']", RequireStake: "//input[@name='proposeStakeRequired']", MinAmount: "//input[@name='minXtzAmount']", MaxAmount: "//input[@name='maxXtzAmount']", ContinueButton3: "//p[text()='Continue']", - QuorumThreshold:"//input[@name='quorumThreshold']", - QuorumChange:"//input[@name='quorumChange']", - MinQuorumAmount:"//input[@name='minQuorumAmount']", - QuorumMaxChange:"//input[@name='quorumMaxChange']", - MaxQuorumAmount:"//input[@name='maxQuorumAmount']", + QuorumThreshold: "//input[@name='quorumThreshold']", + QuorumChange: "//input[@name='quorumChange']", + MinQuorumAmount: "//input[@name='minQuorumAmount']", + QuorumMaxChange: "//input[@name='quorumMaxChange']", + MaxQuorumAmount: "//input[@name='maxQuorumAmount']", ContinueButton4: "//p[text()='Continue']", ContinueButton5: "//p[text()='Continue']", SelfDeployed: " //p[text()='Self-Deployed']", @@ -61,28 +62,59 @@ const pageLocators = { DeployDAO: "//p[text()='Deploy DAO']", DAOText: "Go to my DAO", ErrorText: "Required", + ConsoleDAOName:"//p[@class='MuiTypography-root jss30 jss31 MuiTypography-body1 MuiTypography-colorTextPrimary']", + DAOClass:"//p[@class='MuiTypography-root jss30 jss31 MuiTypography-body1 MuiTypography-colorTextPrimary']", }, - ChangeConfiguration: { - DAOConfiguration: "//p[text()='DAO Configuration']", - ProposalFee: "//input[@name='frozen_extra_value']", - ReturnedTokenPercentage: "//input[@name='returnedPercentage']", - SubmitButton: "//span[text()='Submit']", - TransactionText: "", + AcceptDelegation:{ + EditButton:"//p[text()='Edit']", + AcceptButton:"//input[@value='ACCEPT_DELEGATIONS']", + SubmitButton:"//span[text()='Submit']", + TransactionText:"Delegate transaction confirmed", }, - ChangeGuardian: { - ChangeGuardian: "//p[text()='Change Guardian']", - WalletAddress: "input[placeholder=' tz1...']", - SubmitButton: '//span[text()="Submit"]', - TransactionText: "Guardian change proposal transaction confirmed", + TokenStaking: { + User: "//p[text()='User']", + Deposit: "//span[text()='Deposit']", + PassAmount: "//input[@placeholder='0']", + UseMax: "//p[text()='Use Max']", + Submit: "//span[text()='Submit']", + TransactionText: "Deposit transaction confirmed", + Balance: "//div[@class='MuiGrid-root MuiGrid-container MuiGrid-item MuiGrid-justify-content-xs-space-between']", }, - ChangeDelegate: { - ChangeDelegate: "//p[text()='Change Delegate']", - NewDelegateAddress: "input[placeholder=' tz1...']", - SubmitButton: "//span[text()='Submit']", - TransactionText: "Delegation change proposal transaction confirmed", + OffChainPoll: { + DAO: `//p[text()='${DAONam}']`, + Proposal: "//p[text()='Proposals']", + cycle: "//p[text()='Creating']", + NewProposal: "//span[text()='New Proposal']", + OffChainPoll: "//p[text()='Off Chain Poll']", + ProposalTitle: "input[placeholder='Proposal Title*']", + ShortDescription: "textarea[placeholder='Short description']", + ExternalLink: "input[placeholder='External Link']", + multipleChoice: "input[value='1']", + Choice1: "input[placeholder='Choice 1']", + AddChoice: ".MuiButtonBase-root.MuiIconButton-root.MuiIconButton-sizeSmall", + Choice2: "input[placeholder='Choice 2']", + Choice3: "input[placeholder='Choice 3']", + DD: "input[placeholder='DD']", + HH: "input[placeholder='HH']", + MM: "input[placeholder='MM']", + CreateProposalButton: "button[class='MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedSecondary']", + CreateText: "Proposal created", + }, + + VoteOnOffChainPoll: { + ProposalTitle: "//h4[text()='GOV']", + Choice1: "//p[text()='Democracy']", + Choice2: "//p[text()='Exploration']", + CastYourVote: "//span[text()='Cast your vote']", + VoteDone: "Your vote has been submitted", + }, + + CorrectVoteCount: { + VoteCount: "div[class='MuiGrid-root MuiGrid-container MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-sm-6 MuiGrid-grid-md-6 MuiGrid-grid-lg-6'] p[class='MuiTypography-root MuiTypography-body1 MuiTypography-colorSecondary']", + Options: "//div[@class='MuiGrid-root MuiGrid-container MuiGrid-item MuiGrid-justify-content-xs-flex-end MuiGrid-grid-xs-12 MuiGrid-grid-sm-6 MuiGrid-grid-lg-6']", }, TransferToken: { @@ -96,7 +128,16 @@ const pageLocators = { TransactionText: "Registry proposal transaction confirmed", }, + ChangeConfiguration: { + DAOConfiguration: "//p[text()='DAO Configuration']", + ProposalFee: "//input[@name='frozen_extra_value']", + ReturnedTokenPercentage: "//input[@name='returnedPercentage']", + SubmitButton: "//span[text()='Submit']", + TransactionText: "", + }, + TransferNFT: { + DAO: "", NFTs: "//span[text()='NFTs']", }, @@ -115,7 +156,7 @@ const pageLocators = { AddLambda: "//p[text()='Add Lambda']", TestBox: ".npm__react-simple-code-editor__textarea", SubmitButton: "//span[text()='Submit']", - TransactionText: "", + TransactionText: "Add Lambda proposal transaction confirmed", }, @@ -123,16 +164,31 @@ const pageLocators = { RemoveLambda: "//p[text()='Remove Lambda']", SearchBox: "#combo-box-demo", SubmitButton: "//span[text()='Submit']", - TransactionText:"", + TransactionText: "Remove Lambda proposal transaction confirmed", }, ExecuteLambda: { ExecuteLambda: "//p[text()='Execute Lambda']", SearchBox: "#combo-box-demo", - LambdaArgumentsCode: 'Write Michelson Code for the input Paramerers of your Lambda\n\nEg:-\n\n{\n "prim": "pair",\n "annots": [\n "%xtz_transfer_type"\n ],\n "args": [\n {\n "prim": "mutez",\n "annots": [\n "%amount"\n ]\n },\n {\n "prim": "address",\n "annots": [\n "%recipient"\n ]\n }\n ]\n},\n', - LambdaParams: 'Enter the values for the given params in a JSON/JavaScript Object format.\n\nEg:-\n\n{\n xtz_transfer_type: {\n amount: 10000000000000000000,\n recipient: "tz1VSUr8wwNhLAzempoch5d6hLRiTh8Cjcjb"\n }\n}\n ', + Dropdown: "//button[@class='MuiButtonBase-root MuiIconButton-root MuiAutocomplete-popupIndicator']", + LambdaArgumentsCode: "(//textarea[@class='npm__react-simple-code-editor__textarea'])[2]", + LambdaParams: "(//textarea[@class='npm__react-simple-code-editor__textarea'])[3]", SubmitButton: "//span[text()='Submit']", - TransactionText:"", + TransactionText: "Execute Lambda proposal transaction confirmed", + }, + + ChangeDelegate: { + ChangeDelegate: "//p[text()='Change Delegate']", + NewDelegateAddress: "input[placeholder=' tz1...']", + SubmitButton: "//span[text()='Submit']", + TransactionText: "Delegation change proposal transaction confirmed", + }, + + ChangeGuardian: { + ChangeGuardian: "//p[text()='Change Guardian']", + WalletAddress: "input[placeholder=' tz1...']", + SubmitButton: '//span[text()="Submit"]', + TransactionText: "Guardian change proposal transaction confirmed", }, VoteOnProposal: { @@ -140,17 +196,21 @@ const pageLocators = { OnChainButton: "//button[@class='MuiButtonBase-root MuiButton-root MuiButton-text jss417']", Active: "//p[text()='Active']", Pending: "//p[text()='Pending']", + NoQuorum: "//p[text()='No Quorum']", + Expired: "//p[text()='Expired']", + Rejected: "//p[text()='Rejected']", VoteFor: "//span[text()='Vote For']", VoteAgainst: "//span[text()='Vote Against']", UseMax: "//p[text()='Use Max']", + Amount: "//input[@placeholder='Type an Amount']", Submit: "//span[text()='Submit']", View: "//span[text()='View']", Support: ".MuiGrid-root.MuiGrid-container.MuiGrid-item.MuiGrid-wrap-xs-nowrap.MuiGrid-align-items-xs-baseline.MuiGrid-grid-md-12", Oppose: ".MuiGrid-root.MuiGrid-container.MuiGrid-wrap-xs-nowrap.MuiGrid-align-items-xs-center.MuiGrid-grid-md-12", - + TransactionText: "Vote transaction confirmed", }, - ProposalExecutionAndDrop: { + ProposalExecution: { PassedExecutable: "//p[text()='Passed - Executable']", Passed: "//p[text()='Passed']", NoQuorum: "//p[text()='No Quorum']", @@ -159,53 +219,12 @@ const pageLocators = { PercentageText: "//p[@class='MuiTypography-root jss1339 jss1340 MuiTypography-body1']", DropExpired: "//span[text()='Drop Expired']", Execute: "//span[text()='Execute']", + TransactionText: "Execute proposal transaction confirmed", }, - OffChainPoll: { - MaskDAO: "//p[text()='Mask DAO']", - Proposal: "//p[text()='Proposals']", - cycle: "//p[text()='Creating']", - NewProposal: "//span[text()='New Proposal']", - OffChainPoll: "//p[text()='Off Chain Poll']", - ProposalTitle: "input[placeholder='Proposal Title*']", - ShortDescription: "textarea[placeholder='Short description']", - ExternalLink: "input[placeholder='External Link']", - multipleChoice: "input[value='1']", - Choice1: "input[placeholder='Choice 1']", - AddChoice: ".MuiButtonBase-root.MuiIconButton-root.MuiIconButton-sizeSmall", - Choice2: "input[placeholder='Choice 2']", - Choice3: "input[placeholder='Choice 3']", - DD: "input[placeholder='DD']", - HH: "input[placeholder='HH']", - MM: "input[placeholder='MM']", - CreateProposalButton: "button[class='MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedSecondary']", - CreateText: "//div[text()='Proposal created!']", - CloseButton:'.MuiBox-root > .MuiSvgIcon-root', - }, - - VoteOnOffChainPoll: { - ProposalName: "//h4[text()='Community Governance']", - Option1: "//div[@class='Introduce Liquid Democracy']", - Option2: "//p[text()='Increase Proposal Exploration Period']", - CastYourVote: "//span[text()='Cast your vote']", - VoteDone: "Your vote has been submitted", - }, - - CorrectVoteCount: { - VoteCount: "div[class='MuiGrid-root MuiGrid-container MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-sm-6 MuiGrid-grid-md-6 MuiGrid-grid-lg-6'] p[class='MuiTypography-root MuiTypography-body1 MuiTypography-colorSecondary']", - Options: "//div[@class='MuiGrid-root MuiGrid-container MuiGrid-item MuiGrid-justify-content-xs-flex-end MuiGrid-grid-xs-12 MuiGrid-grid-sm-6 MuiGrid-grid-lg-6']", - - - }, - - TokenStaking: { - User: "//p[text()='User']", - Deposit: "//span[text()='Deposit']", - PassAmount: "//input[@placeholder='0']", - UseMax: "//p[text()='Use Max']", - Submit: "//span[text()='Submit']", - TransactionText: "Deposit transaction confirmed", - Balance:"//div[@class='MuiGrid-root MuiGrid-container MuiGrid-item MuiGrid-justify-content-xs-space-between']", + ProposalDrop: { + ProposalDrop: "//span[text()='Drop Proposal']", + TransactionText: "Drop proposal transaction confirmed", }, UnStakingToken: { @@ -219,6 +238,7 @@ const pageLocators = { UseMax: "//p[text()='Use Max']", Submit: "//span[text()='Submit']", TransactionText: "Withdrawal transaction confirmed", + AvailableBalance: "0", } }; diff --git a/tests/CommonFile/PreAction.js b/tests/CommonFile/PreAction.js index 5ab4a7e..99d89cc 100644 --- a/tests/CommonFile/PreAction.js +++ b/tests/CommonFile/PreAction.js @@ -1,18 +1,20 @@ const { test } = require("@playwright/test"); -const { pageLocators } = require ("./Locator"); +const { pageLocators } = require("./Locator"); const { changeNetwork } = require("./Action"); -async function PreProposal(page){ +async function PreProposal(page) { + + test.setTimeout(5 * 60 * 1000); //Extending Test Case timeout to 5 minutes await changeNetwork(page); //PreConditions Open URL and Selecting the Ghost-net - await page.click(pageLocators.OffChainPoll.MaskDAO); //Click on Mask DAO + await page.click(pageLocators.OffChainPoll.DAO) // Use DAOName to locate elements on the page await page.click(pageLocators.OffChainPoll.Proposal); //Click on Proposal - + } -module.exports= { +module.exports = { PreProposal } \ No newline at end of file diff --git a/tests/CommonFile/PreTokenStaking.js b/tests/CommonFile/PreTokenStaking.js deleted file mode 100644 index 8ec7118..0000000 --- a/tests/CommonFile/PreTokenStaking.js +++ /dev/null @@ -1,28 +0,0 @@ -const { test, expect } = require("@playwright/test"); -const { PreProposal } = require("../CommonFile/PreAction"); -const { pageLocators } = require("../CommonFile/Locator"); -const { TezosTestData } = require("../CommonFile/TestData"); - -async function PreTokenStaking(page){ - - test.setTimeout(10 * 60 * 1000); //Extending Test Case timeout to 10 minutes - - await PreProposal(page); //PreConditions Open URL and Open Mask DAO For Proposal - - await page.click(pageLocators.TokenStaking.User); //Click on the User Tab - - await page.click(pageLocators.TokenWithdrawal.Withdraw); //Click On withdrawal Button - - // await page.type(pageLocators.TokenWithdrawal.Amount, TezosTestData.TokenWithdrawal.Amount); //Click On the WithDraw Amount - - await page.click(pageLocators.TokenWithdrawal.UseMax); //Click on the Use Max - - await page.click(pageLocators.TokenWithdrawal.Submit); //Click On the Submit Button - - await page.waitForTimeout(30000); //Wait for Transaction Confirmed - -} - -module.exports= { - PreTokenStaking -} \ No newline at end of file diff --git a/tests/CommonFile/PreVoteOnOffChainPoll.js b/tests/CommonFile/PreVoteOnOffChainPoll.js deleted file mode 100644 index 07ce5ae..0000000 --- a/tests/CommonFile/PreVoteOnOffChainPoll.js +++ /dev/null @@ -1,45 +0,0 @@ -const { test, expect } = require("@playwright/test"); -const { PreProposal } = require("./PreAction"); -const { pageLocators } = require("./Locator"); -const { TezosTestData } = require("./TestData"); - -async function PreVoteOnOffChainPoll(page){ - - test.setTimeout(10 * 60 * 1000); //To extend the time of test execution - - await PreProposal(page); //PreConditions Open URL and Open Mask DAO For Proposal - - await page.click(pageLocators.OffChainPoll.NewProposal); //Click on new Proposal - - await page.click(pageLocators.OffChainPoll.OffChainPoll); //Click on Off Chain Poll - - await page.fill(pageLocators.OffChainPoll.ProposalTitle, TezosTestData.OffChainPoll.ProposalTitle); //Pass the Proposal Title - - await page.fill(pageLocators.OffChainPoll.ShortDescription, TezosTestData.OffChainPoll.ShortDescription); //Pass the Short Description - - await page.fill(pageLocators.OffChainPoll.ExternalLink, TezosTestData.OffChainPoll.ExternalLink); //Pass the External Link - - await page.click(pageLocators.OffChainPoll.multipleChoice); // Click on Multiple Choice - - await page.fill(pageLocators.OffChainPoll.Choice1, TezosTestData.OffChainPoll.Choice1); //Pass the Choice 1 Data - - await page.click(pageLocators.OffChainPoll.AddChoice); //Click on Add Choice - - await page.fill(pageLocators.OffChainPoll.Choice2, TezosTestData.OffChainPoll.Choice2); //Pass The Choice 2 Data - - await page.fill(pageLocators.OffChainPoll.DD, TezosTestData.OffChainPoll.DD); //Pass The Date - - await page.fill(pageLocators.OffChainPoll.HH, TezosTestData.OffChainPoll.HH); //Pass The Hours - - await page.fill(pageLocators.OffChainPoll.MM, TezosTestData.OffChainPoll.MM); //Pass The Minute - - await page.click(pageLocators.OffChainPoll.CreateProposalButton); //Click on the Create Proposal Button - - await page.click(pageLocators.OffChainPoll.CloseButton); //Click on x Mark - - -} - -module.exports= { - PreVoteOnOffChainPoll -} \ No newline at end of file diff --git a/tests/CommonFile/TestData.js b/tests/CommonFile/TestData.js index 744837b..8060959 100644 --- a/tests/CommonFile/TestData.js +++ b/tests/CommonFile/TestData.js @@ -1,27 +1,27 @@ const TezosTestData = { TokenCreator: { - TokenName: "My token name", - TokenDescription: "My Token Descriptions", + TokenName: `New${Math.floor(+new Date() / 1000)}Token`, + TokenDescription: "My Silver Descriptions", TC02TokenDescription: "", - SupplyToken: "100", - Decimals: "18", - Symbol: "#", + SupplyToken: "1000000", + Decimals: "11", + Symbol: "$", Icon: "Picture.PNG", WalletAddress: "tz1LCFwczMiEuNHcMvpqgNzzEs8f4FNBgyNK", - Amount: "100", + Amount: "1000000", }, DAOCreate: { - DAOName: "Decentralized", - TokenAddress: "KT1Dmxer8pvx8vTUX5V2k44th4DqnKsjhUya", + DAOName: `New${Math.floor(+new Date() / 1000)}DAO`, TokenID: "0", + TokenAddress: "KT1VPiQUCrYSzicaNa5yWhndt7K19HYUCGzP", GuardianAddress: "tz1LCFwczMiEuNHcMvpqgNzzEs8f4FNBgyNK", Description: "A DAO focused on funding and promoting open-source projects related to sustainability and renewable energy.", TC04DAODescription: "", VotingDays: '00', VotingHours: '00', - VotingMinutes: "03", + VotingMinutes: "07", ExecutionDays: "00", ExecutionHours: "00", ExecutionMinutes: "01", @@ -34,46 +34,48 @@ const TezosTestData = { QuorumMaxChange: '19', MaxQuorumAmount: '90', RequiredStake: "10", - MinAmount: "10", - MaxAmount: "20", + MinAmount: "1", + MaxAmount: "200000", }, - ChangeConfiguration: { - - ProposalFee: "1", - ReturnedTokenPercentage: "1", + OffChainPoll: { + ProposalTitle: "GOV", + ShortDescription: "This proposal aims to conduct an off-chain poll to gather community input on potential upgrades to the Tezos governance process.", + ExternalLink: "https://tezos-gov-upgrades.com", + Choice1: "Democracy", + Choice2: "Exploration", + DD: "00", + HH: "00", + MM: "20", + }, + ChangeConfiguration: { + ProposalFee: "14", + ReturnedTokenPercentage: "63" }, ChangeGuardian: { - WalletAddress: "tz1VSUr8wwNhLAzempoch5d6hLRiTh8Cjcjb", - + WalletAddress: "tz1hhjjjnCe7ePEKGRaArKzqyKpgQtrTK3RD", }, ChangeDelegate: { - NewDelegateAddress: "tz1VxgGHwU6T6MaWrzfCBSpg2tw823KWVbk6", + NewDelegateAddress: "tz1LY2KJKKkXbA7EoN8K2rd8X1GDgcfj5zy6", }, TransferToken: { - RecipientAddress: "tz1VxgGHwU6T6MaWrzfCBSpg2tw823KWVbk6", - Asset: "SRD", - Amount: "10", - AgoraPostID: "10", - }, - - TransferNFT: { - + RecipientAddress: "tz1MBFA5nJgPgkp1ThXHcSs4YLuUrHmUM1Ef", + Asset: "$", + Amount: "12", + AgoraPostID: "0", }, EditRegistry: { - Key: "Hello", - Value: "Hi", - + Key: "Home ", + Value: "Documents", }, AddLambda: { - MichelsonCode: ".npm__react-simple-code-editor__textarea", - + MichelsonCode: "Extract the lambda and an integer from the parameter", }, RemoveLambda: { @@ -81,43 +83,24 @@ const TezosTestData = { }, ExecuteLambda: { - SearchText: "transfer_proposal", LambdaArgumentsCode: "Write Michelson Code For the Input", LambdaParams: "Enter the values for the given params in a JSON/JavaScript Object format.", - }, VoteOnProposal: { - + Amount: "300000", }, - ProposalExecutionAndDrop: { - Execute: "//span[text()='Execute']", - DropExpired: "//span[text()='Drop Expired']", - }, - - - OffChainPoll: { - ProposalTitle: "Community Governance", - ShortDescription: "This proposal aims to conduct an off-chain poll to gather community input on potential upgrades to the Tezos governance process.", - ExternalLink: "https://examplelink.com/tezos-gov-upgrades-poll", - Choice1: "Introduce Liquid Democracy", - Choice2: "Increase Proposal Exploration Period", - CreateProposalButton: "button[class='MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedSecondary']", - DD: "01", - HH: "05", - MM: "00", - }, TokenStaking: { - Amount: "000+-e" + Amount: "20" }, TokenWithdrawal: { - Amount: "23456E_+", + Amount: "50", }, +} +const DAONam= TezosTestData.DAOCreate.DAOName; - -} -export { TezosTestData }; \ No newline at end of file +export { TezosTestData , DAONam}; \ No newline at end of file diff --git a/tests/CommonFile/sharedValues.js b/tests/CommonFile/sharedValues.js new file mode 100644 index 0000000..48c03df --- /dev/null +++ b/tests/CommonFile/sharedValues.js @@ -0,0 +1,10 @@ +let TokenAddress; + +module.exports = { + setTokenAddress: (address) => { + TokenAddress = address; + }, + getTokenAddress: () => { + return TokenAddress; + }, +}; \ No newline at end of file diff --git a/tests/TC01/TC01-01_CreateToken.spec.js b/tests/TC01/TC01-01_CreateToken.spec.js index 951c246..f8b6eb1 100644 --- a/tests/TC01/TC01-01_CreateToken.spec.js +++ b/tests/TC01/TC01-01_CreateToken.spec.js @@ -1,54 +1,60 @@ const { test } = require("@playwright/test"); const { changeNetwork } = require("../CommonFile/Action"); const { pageLocators } = require("../CommonFile/Locator"); -const { TezosTestData } = require("../CommonFile/TestData"); + +const { TezosTestData } = require("../CommonFile/TestData"); +const { setTokenAddress } = require("../CommonFile/sharedValues"); - test("Test Case 1: Successful Token Creation", async ({ page }) => { - test.setTimeout(10 * 60 * 1000); //Extending Test Case timeout to 10 minutes +test("Test Case 1: Successful Token Creation", async ({ page }) => { - await changeNetwork(page); //PreConditions Open URL and Selecting the Ghost-net + test.setTimeout(5 * 60 * 1000); //Extending Test Case timeout to 5 minutes - await page.click(pageLocators.TokenCreator.CreateDAO); //Select A Create New DAO + await changeNetwork(page); //PreConditions Open URL and Selecting the Ghost-net - await page.click(pageLocators.TokenCreator.GovernanceToken); //Selecting the Governance Token + await page.click(pageLocators.TokenCreator.CreateDAO); //Select A Create New DAO - await page.fill(pageLocators.TokenCreator.TokenName, TezosTestData.TokenCreator.TokenName); //Pass The Token Name + await page.click(pageLocators.TokenCreator.GovernanceToken); //Selecting the Governance Token - await page.fill(pageLocators.TokenCreator.TokenDescription, TezosTestData.TokenCreator.TokenDescription); //Pass The Token Description + await page.fill(pageLocators.TokenCreator.TokenName, TezosTestData.TokenCreator.TokenName); //Pass The Token Name - await page.fill(pageLocators.TokenCreator.TotalSupply, TezosTestData.TokenCreator.SupplyToken); //Total Supply of Tokens + await page.fill(pageLocators.TokenCreator.TokenDescription, TezosTestData.TokenCreator.TokenDescription); //Pass The Token Description - await page.fill(pageLocators.TokenCreator.Decimals, TezosTestData.TokenCreator.Decimals); //Pass The Decimals + await page.fill(pageLocators.TokenCreator.TotalSupply, TezosTestData.TokenCreator.SupplyToken); //Total Supply of Tokens - await page.fill(pageLocators.TokenCreator.Symbol, TezosTestData.TokenCreator.Symbol); //Pass The Symbol for token + await page.fill(pageLocators.TokenCreator.Decimals, TezosTestData.TokenCreator.Decimals); //Pass The Decimals - await page.fill(pageLocators.TokenCreator.Icon, TezosTestData.TokenCreator.Icon); //Pass The Icon for Token + await page.fill(pageLocators.TokenCreator.Symbol, TezosTestData.TokenCreator.Symbol); //Pass The Symbol for token - await page.click(pageLocators.TokenCreator.ContinueButton1); //Click On Continue Button + await page.fill(pageLocators.TokenCreator.Icon, TezosTestData.TokenCreator.Icon); //Pass The Icon for Token - await page.fill(pageLocators.TokenCreator.WalletAddress, TezosTestData.TokenCreator.WalletAddress); //Pass The Wallet Address + await page.click(pageLocators.TokenCreator.ContinueButton1); //Click On Continue Button - await page.fill(pageLocators.TokenCreator.Amount, TezosTestData.TokenCreator.Amount); //Pass The Amount + await page.fill(pageLocators.TokenCreator.WalletAddress, TezosTestData.TokenCreator.WalletAddress); //Pass The Wallet Address - await page.click(pageLocators.TokenCreator.ContinueButton2); //Click on Continue Button + await page.fill(pageLocators.TokenCreator.Amount, TezosTestData.TokenCreator.Amount); //Pass The Amount - await page.click(pageLocators.TokenCreator.launch); //Click on launch button + await page.click(pageLocators.TokenCreator.ContinueButton2); //Click on Continue Button - await page.waitForTimeout(30000); //Wait for the Token Create + await page.click(pageLocators.TokenCreator.launch); //Click on launch button - const content = await page.content(); //Assume Page + await page.waitForTimeout(30000); //Wait for the Token Create - const isTextVisible = content.includes(pageLocators.TokenCreator.DeployText, { visible: true }); //Verify that text visible on the webpage + const content = await page.content(); //Assume Page - await page.waitForSelector(pageLocators.TokenCreator.ConsoleAddress); //Wait for find the Element + const isTextVisible = content.includes(pageLocators.TokenCreator.DeployText, { visible: true }); //Verify that text visible on the webpage - const element = await page.$(pageLocators.TokenCreator.ConsoleAddress); // get The element + console.log(isTextVisible); //console the results of Token - const textContent = await element.innerText(); //get the text From this element + await page.waitForSelector(pageLocators.TokenCreator.ConsoleAddress); //Wait for find the Element - console.log('Token Address:', textContent); // Console The test Present on the Webpage + const element = await page.$(pageLocators.TokenCreator.ConsoleAddress); // get The element - console.log("The token is successfully created and the user is redirected to a confirmation page with the details of the newly created token."); + const TokenAddress = await element.innerText(); //get the text From this element - }); + console.log('Token Address:', TokenAddress); // Console The token Address + + setTokenAddress(TokenAddress); // Set the TokenAddress value + + console.log("The token is successfully created and the user is redirected to a confirmation page with the details of the newly created token."); + +}); diff --git a/tests/TC01/TC01-02_TokenValues.spec.js b/tests/TC01/TC01-02_TokenValues.spec.js index 6b77015..4361d0e 100644 --- a/tests/TC01/TC01-02_TokenValues.spec.js +++ b/tests/TC01/TC01-02_TokenValues.spec.js @@ -5,7 +5,7 @@ const { TezosTestData } = require("../CommonFile/TestData"); test("Test Case 2: Token Creation with Various Input Values", async ({ page, }) => { - test.setTimeout(10 * 60 * 1000); //Extending Test Case timeout to 10 minutes + test.setTimeout(5 * 60 * 1000); //Extending Test Case timeout to 5 minutes await changeNetwork(page); //PreConditions Open URL and selecting the Ghost-net diff --git a/tests/TC01/TC01-03_CreateDAO.spec.js b/tests/TC01/TC01-03_CreateDAO.spec.js index f05e641..1104ba1 100644 --- a/tests/TC01/TC01-03_CreateDAO.spec.js +++ b/tests/TC01/TC01-03_CreateDAO.spec.js @@ -1,11 +1,14 @@ -const { test, expect } = require('@playwright/test'); +const { test } = require('@playwright/test'); const { changeNetwork } = require("../CommonFile/Action"); const { pageLocators } = require("../CommonFile/Locator"); const { TezosTestData } = require("../CommonFile/TestData"); +const { getTokenAddress } = require("../CommonFile/sharedValues"); test('Test Case 3 : Create DAO Successfully', async ({ page }) => { - - test.setTimeout(10 * 60 * 1000); //Extending Test Case timeout to 10 minutes + + const tokenAddress = getTokenAddress(); // Retrieve the TokenAddress value when needed + + test.setTimeout(5 * 60 * 1000); //Extending Test Case timeout to 5 minutes await changeNetwork(page); //PreConditions Open URL and Selecting the Ghost-net @@ -19,7 +22,7 @@ test('Test Case 3 : Create DAO Successfully', async ({ page }) => { await page.fill(pageLocators.DAOCreate.DAOName, TezosTestData.DAOCreate.DAOName); //Fill DAO Name - await page.fill(pageLocators.DAOCreate.TokenAddress, TezosTestData.DAOCreate.TokenAddress); //Fill Token Address + await page.fill(pageLocators.DAOCreate.TokenAddress,tokenAddress); //Fill Token Address await page.fill(pageLocators.DAOCreate.TokenID, TezosTestData.DAOCreate.TokenID); //Fill Token ID @@ -30,7 +33,7 @@ test('Test Case 3 : Create DAO Successfully', async ({ page }) => { await page.waitForTimeout(2000); //Wait For Click on Continue Button await page.click(pageLocators.DAOCreate.ContinueButton2); //Click on Continue - + await page.fill(pageLocators.DAOCreate.VotingDays, TezosTestData.DAOCreate.VotingDays); //Pass The Voting Cycle Days Duration await page.fill(pageLocators.DAOCreate.VotingHours, TezosTestData.DAOCreate.VotingHours); //Pass The Voting Cycle Hours Duration @@ -105,6 +108,8 @@ test('Test Case 3 : Create DAO Successfully', async ({ page }) => { const isTextVisible = content.includes(pageLocators.DAOCreate.DAOText, { visible: true }); //Verify that text visible on the webpage + console.log(isTextVisible); //Show the Results of True of false + console.log("The DAO is successfully created and the user is redirected to a confirmation page that links to the newly created DAO"); }) \ No newline at end of file diff --git a/tests/TC01/TC01-04_DAOValues.spec.js b/tests/TC01/TC01-04_DAOValues.spec.js index d7a6293..c687c1c 100644 --- a/tests/TC01/TC01-04_DAOValues.spec.js +++ b/tests/TC01/TC01-04_DAOValues.spec.js @@ -5,7 +5,7 @@ const { TezosTestData } = require("../CommonFile/TestData"); test('Test Case 4 : Create DAO with various input values', async ({ page }) => { - test.setTimeout(10 * 60 * 1000); //Extending Test Case timeout to 10 minutes + test.setTimeout(5 * 60 * 1000); //Extending Test Case timeout to 5 minutes await changeNetwork(page); //PreConditions Open URL and Selecting the Ghost-net diff --git a/tests/TC04/TC04-01_OffChainPoll.spec.js b/tests/TC02/TC02-01_OffChainPoll.spec.js similarity index 85% rename from tests/TC04/TC04-01_OffChainPoll.spec.js rename to tests/TC02/TC02-01_OffChainPoll.spec.js index 9f8fd73..57e3960 100644 --- a/tests/TC04/TC04-01_OffChainPoll.spec.js +++ b/tests/TC02/TC02-01_OffChainPoll.spec.js @@ -5,7 +5,7 @@ const { TezosTestData } = require("../CommonFile/TestData"); test('Test case 1: Off Chain Poll Proposal Creation', async ({ page }) => { - test.setTimeout(10 * 60 * 1000); //Extending Test Case timeout to 10 minutes + test.setTimeout(5 * 60 * 1000); //Extending Test Case timeout to 5 minutes await PreProposal(page); //PreConditions Open URL and Open Mask DAO For Proposal @@ -35,9 +35,13 @@ test('Test case 1: Off Chain Poll Proposal Creation', async ({ page }) => { await page.click(pageLocators.OffChainPoll.CreateProposalButton); //Click on the Create Proposal Button + await page.waitForTimeout(12000); //Wait for the transaction + const content = await page.content(); //Assume Page + + const isTextVisible = content.includes(pageLocators.OffChainPoll.CreateText, { visible: true }); //Wait for Text Visible on Webpage - await page.waitForSelector(pageLocators.OffChainPoll.CreateText, { visible: true }); //Wait for Text Visible on Webpage + console.log(isTextVisible); //Console the results console.log("The poll is successfully created and the user is redirected to a confirmation page with the details of the newly created poll."); diff --git a/tests/TC02/TC02-02_VoteonOffChainPoll.spec.js b/tests/TC02/TC02-02_VoteonOffChainPoll.spec.js new file mode 100644 index 0000000..0ec1608 --- /dev/null +++ b/tests/TC02/TC02-02_VoteonOffChainPoll.spec.js @@ -0,0 +1,30 @@ +const { test, expect } = require("@playwright/test"); +const { pageLocators } = require("../CommonFile/Locator"); +const { PreProposal } = require("../CommonFile/PreAction"); +const { TezosTestData } = require("../CommonFile/TestData"); + +test('Test case 2: Vote On Off Chain Proposal ', async ({ page }) => { + + test.setTimeout(5 * 60 * 1000); //Extending Test Case timeout to 5 minutes + + await PreProposal(page); //PreConditions Open URL and Open Mask DAO For Proposal + + await page.waitForTimeout(2000); //Wait for page Load + + await page.click(pageLocators.VoteOnOffChainPoll.ProposalTitle); //Click on the Proposal Name + + await page.click(pageLocators.VoteOnOffChainPoll.Choice1); //Click On Option 1 + + await page.click(pageLocators.VoteOnOffChainPoll.CastYourVote); //Submit Your Votes + + await page.waitForTimeout(12000); //wait for CastYourVote + + const content = await page.content(); //Assume Page + + const isTextVisible = content.includes(pageLocators.VoteOnOffChainPoll.VoteDone, { visible: true }); //Verify that text visible on the webpage + + console.log(isTextVisible); //Prints True or false for is Text Visible + + console.log("The vote is successfully recorded and the user is redirected to a confirmation page with the details of the vote."); + +}) \ No newline at end of file diff --git a/tests/TC04/TC04-03_CorrectVoteCountOnOffChainPoll.spec.js b/tests/TC02/TC02-03_CorrectVoteCountOnOffChainPoll.spec.js similarity index 87% rename from tests/TC04/TC04-03_CorrectVoteCountOnOffChainPoll.spec.js rename to tests/TC02/TC02-03_CorrectVoteCountOnOffChainPoll.spec.js index c1d03f9..c8cbfb5 100644 --- a/tests/TC04/TC04-03_CorrectVoteCountOnOffChainPoll.spec.js +++ b/tests/TC02/TC02-03_CorrectVoteCountOnOffChainPoll.spec.js @@ -4,11 +4,11 @@ const { pageLocators } = require("../CommonFile/Locator"); test('Test case 3: Correct vote Count on Off Chain Poll ', async ({ page }) => { - test.setTimeout(10 * 60 * 1000); //Extending Test Case timeout to 10 minutes + test.setTimeout(5 * 60 * 1000); //Extending Test Case timeout to 5 minutes await PreProposal(page); //PreConditions Open URL and Open Mask DAO For Proposal - await page.click(pageLocators.VoteOnOffChainPoll.ProposalName); + await page.click(pageLocators.VoteOnOffChainPoll.ProposalTitle); //Click on proposal title await page.waitForSelector(pageLocators.CorrectVoteCount.VoteCount); //Wait for find the Element diff --git a/tests/TC02/TC02-05_TransferNFT.spec.js b/tests/TC02/TC02-05_TransferNFT.spec.js deleted file mode 100644 index 14586b7..0000000 --- a/tests/TC02/TC02-05_TransferNFT.spec.js +++ /dev/null @@ -1,28 +0,0 @@ -const { test, expect } = require("@playwright/test"); -const { PreProposal } = require("../CommonFile/PreAction"); -const { pageLocators } = require("../CommonFile/Locator"); -const { TezosTestData } = require("../CommonFile/TestData"); -const path = require('path'); - -test('Test case 5: Transfer NFT ', async ({ page }) => { - - await PreProposal(page); //PreConditions Open URL and Open Mask DAO For Proposal - - try { - - test.setTimeout(10 * 60 * 1000); //Extending Test Case timeout to 10 minutes - - await page.click(pageLocators.OffChainPoll.cycle); // Click on Running Cycle Status - - await page.click(pageLocators.TransferToken.Treasury); //Click on the Treasury - - await page.click(pageLocators.TransferNFT.NFTs); //Click on the NFT Button - - console.log("The proposal is successfully created and the user is redirected to a confirmation page with the details of the newly created proposal."); - - } - catch (error) { - console.log("Now Voting Cycle is Running"); - } - -}) \ No newline at end of file diff --git a/tests/TC03/TC03-01_TokenDeposit.spec.js b/tests/TC03/TC03-01_TokenDeposit.spec.js new file mode 100644 index 0000000..ef84fdc --- /dev/null +++ b/tests/TC03/TC03-01_TokenDeposit.spec.js @@ -0,0 +1,34 @@ +const { test, expect } = require("@playwright/test"); +const { PreProposal } = require("../CommonFile/PreAction"); +const { pageLocators } = require("../CommonFile/Locator"); +const { TezosTestData } = require("../CommonFile/TestData"); + +test('Test case 1: Successful Token Deposit', async ({ page }) => { + + test.setTimeout(5 * 60 * 1000); //Extending Test Case timeout to 5 minutes + + await PreProposal(page); //PreConditions Open URL and Open Mask DAO For Proposal + + await page.click(pageLocators.TokenStaking.User); //Click on the User ON the Tab + + await page.click(pageLocators.TokenStaking.Deposit); //Click on the Deposit Button + + await page.click(pageLocators.TokenStaking.UseMax); //Click on the User Max + + await page.waitForTimeout(2000); //Wait for the type numbers in text box + + await page.click(pageLocators.TokenStaking.Submit); //Click on the Submit Button + + await page.waitForTimeout(30000); //Wait for Transaction Confirmed + + const content = await page.content(); //Assume Page + + const isTextVisible = content.includes(pageLocators.TokenStaking.TransactionText, { visible: true }); //Verify that text visible on the webpage + + console.log(isTextVisible); //Console the results of Text + + expect(isTextVisible).toBe(true, "The tokens are not successfully staked or the text is not visible"); + + console.log("The tokens are successfully staked and and show up as available balance field"); + +}) \ No newline at end of file diff --git a/tests/TC03/TC03-02_AcceptDelegation.spec.js b/tests/TC03/TC03-02_AcceptDelegation.spec.js new file mode 100644 index 0000000..892dc5a --- /dev/null +++ b/tests/TC03/TC03-02_AcceptDelegation.spec.js @@ -0,0 +1,32 @@ +const { test, expect } = require("@playwright/test"); +const { PreProposal } = require("../CommonFile/PreAction"); +const { pageLocators } = require("../CommonFile/Locator"); +const { TezosTestData } = require("../CommonFile/TestData"); + +test('Test case 2: Accept Delegations', async ({ page }) => { + + test.setTimeout(5 * 60 * 1000); //Extending Test Case timeout to 5 minutes + + await PreProposal(page); //PreConditions Open URL and Open Mask DAO For Proposal + + await page.click(pageLocators.TokenStaking.User); //Click on the User ON the Tab + + await page.click(pageLocators.AcceptDelegation.EditButton); //Click on the Edit Button + + await page.click(pageLocators.AcceptDelegation.AcceptButton); //click on Accept Button + + await page.click(pageLocators.AcceptDelegation.SubmitButton); //Click on the Submit Button + + await page.waitForTimeout(30000); //Wait for Transaction Confirmed + + const content = await page.content(); //Assume Page + + const isTextVisible = content.includes(pageLocators.AcceptDelegation.TransactionText, { visible: true }); //Verify that text visible on the webpage + + console.log(isTextVisible); //Console the results of Text + + expect(isTextVisible).toBe(true, "The Accept delegation are not successfully accepted."); + + console.log("The Accepted Delegation transaction are successfully passed."); + +}) \ No newline at end of file diff --git a/tests/TC03/TC03-02_ProposalExecutionandDrop.spec.js b/tests/TC03/TC03-02_ProposalExecutionandDrop.spec.js deleted file mode 100644 index 14712da..0000000 --- a/tests/TC03/TC03-02_ProposalExecutionandDrop.spec.js +++ /dev/null @@ -1,30 +0,0 @@ -const { test, expect } = require("@playwright/test"); -const { PreProposal } = require("../CommonFile/PreAction"); -const { pageLocators } = require("../CommonFile/Locator"); - -test('Test case 2: On-Chain Proposal Execution & Drop', async ({ page }) => { - - test.setTimeout(10 * 60 * 1000); //Extending Test Case timeout to 10 minutes - - await PreProposal(page); //PreConditions Open URL and Open Mask DAO For Proposal - - try { - - await page.click(pageLocators.OffChainPoll.cycle); // Click on Running Cycle Status - - if (await page.waitForLoadState(pageLocators.ProposalExecutionAndDrop.PassedExecutable)) { //Click on the Passed - Execute able - - if (await page.waitForSelector(pageLocators.ProposalExecutionAndDrop.Execute, { click: true })) { //Validate That Button is clickable or not - - await page.click(pageLocators.ProposalExecutionAndDrop.Execute); //Click on Execute Button - } - } else { - await page.click(pageLocators.ProposalExecutionAndDrop.DropExpired); //Click on drop Expired Proposal - } - - } - catch (error) { - console.log("Error"); - } - -}) \ No newline at end of file diff --git a/tests/TC02/TC02-03_TransferTokens.spec.js b/tests/TC04/TC04-01_TransferTokens.spec.js similarity index 92% rename from tests/TC02/TC02-03_TransferTokens.spec.js rename to tests/TC04/TC04-01_TransferTokens.spec.js index 77c09c1..b8443d7 100644 --- a/tests/TC02/TC02-03_TransferTokens.spec.js +++ b/tests/TC04/TC04-01_TransferTokens.spec.js @@ -3,13 +3,13 @@ const { PreProposal } = require("../CommonFile/PreAction"); const { pageLocators } = require("../CommonFile/Locator"); const { TezosTestData } = require("../CommonFile/TestData"); -test('Test case 3: Transfer Tokens', async ({ page }) => { - +test('Test case 1: Transfer Tokens', async ({ page }) => { + await PreProposal(page); //PreConditions Open URL and Open Mask DAO For Proposal try { - test.setTimeout(10 * 60 * 1000); //Extending Test Case timeout to 10 minutes + test.setTimeout(5 * 60 * 1000); //Extending Test Case timeout to 5 minutes await page.click(pageLocators.OffChainPoll.cycle); // Click on Running Cycle Status @@ -23,7 +23,7 @@ test('Test case 3: Transfer Tokens', async ({ page }) => { await page.waitForTimeout(2000) //Wait For Locate The Token - await page.keyboard.press('ArrowDown'); //Click on DownArrow Button + await page.keyboard.press('ArrowDown'); //Click on DownArrow Button await page.keyboard.press('Enter'); //Click on Enter Button diff --git a/tests/TC02/TC02-04_ChangeConfiguration.spec.js b/tests/TC04/TC04-02_ChangeConfiguration.spec.js similarity index 88% rename from tests/TC02/TC02-04_ChangeConfiguration.spec.js rename to tests/TC04/TC04-02_ChangeConfiguration.spec.js index 69c146e..54edf19 100644 --- a/tests/TC02/TC02-04_ChangeConfiguration.spec.js +++ b/tests/TC04/TC04-02_ChangeConfiguration.spec.js @@ -3,13 +3,13 @@ const { PreProposal } = require("../CommonFile/PreAction"); const { pageLocators } = require("../CommonFile/Locator"); const { TezosTestData } = require("../CommonFile/TestData"); -test('Test case 4: Change Configuration', async ({ page }) => { +test('Test case 2: Change Configuration', async ({ page }) => { await PreProposal(page); //PreConditions Open URL and Open Mask DAO For Proposal try { - test.setTimeout(10 * 60 * 1000); //Extending Test Case timeout to 10 minutes + test.setTimeout(5 * 60 * 1000); //Extending Test Case timeout to 5 minutes await page.click(pageLocators.OffChainPoll.cycle); // Click on Running Cycle Status @@ -18,10 +18,8 @@ test('Test case 4: Change Configuration', async ({ page }) => { await page.click(pageLocators.ChangeConfiguration.DAOConfiguration); //Click on DAO Configuration await page.fill(pageLocators.ChangeConfiguration.ProposalFee, TezosTestData.ChangeConfiguration.ProposalFee); // Pass The Proposal Fee - //await page.keyboard.type('1'); await page.fill(pageLocators.ChangeConfiguration.ReturnedTokenPercentage, TezosTestData.ChangeConfiguration.ReturnedTokenPercentage); //Pass The Returned Token Percentage - //await page.keyboard.type('1'); await page.waitForTimeout(2000); //Wait For Type The Letters diff --git a/tests/TC04/TC04-02_VoteonOffChainPoll.spec.js b/tests/TC04/TC04-02_VoteonOffChainPoll.spec.js deleted file mode 100644 index 25fd8a9..0000000 --- a/tests/TC04/TC04-02_VoteonOffChainPoll.spec.js +++ /dev/null @@ -1,21 +0,0 @@ -const { test, expect } = require("@playwright/test"); -const { pageLocators } = require("../CommonFile/Locator"); -const { PreVoteOnOffChainPoll } = require("../CommonFile/PreVoteOnOffChainPoll"); - -test('Test case 2: Vote On Off Chain Proposal ', async ({ page }) => { - - test.setTimeout(10 * 60 * 1000); //Extending Test Case timeout to 10 minutes - - await PreVoteOnOffChainPoll(page); //PreConditions Open URL and Open Mask DAO For Proposal - - await page.waitForTimeout(2000); //Wait for page Load - - await page.click(pageLocators.VoteOnOffChainPoll.ProposalName); //Click on the Proposal Name - - await page.click(pageLocators.VoteOnOffChainPoll.Option2); //Click On Option 2 - - await page.click(pageLocators.VoteOnOffChainPoll.CastYourVote); //Submit Your Votes - - console.log("The vote is successfully recorded and the user is redirected to a confirmation page with the details of the vote."); - -}) \ No newline at end of file diff --git a/tests/TC02/TC02-06_EditRegistry.spec.js b/tests/TC04/TC04-03_EditRegistry.spec.js similarity index 91% rename from tests/TC02/TC02-06_EditRegistry.spec.js rename to tests/TC04/TC04-03_EditRegistry.spec.js index 934fb7d..33a588b 100644 --- a/tests/TC02/TC02-06_EditRegistry.spec.js +++ b/tests/TC04/TC04-03_EditRegistry.spec.js @@ -3,13 +3,13 @@ const { PreProposal } = require("../CommonFile/PreAction"); const { pageLocators } = require("../CommonFile/Locator"); const { TezosTestData } = require("../CommonFile/TestData"); -test('Test case 6: Edit Registry', async ({ page }) => { - +test('Test case 3: Edit Registry', async ({ page }) => { + await PreProposal(page); //PreConditions Open URL and Open Mask DAO For Proposal try { - test.setTimeout(10 * 60 * 1000); //Extending Test Case timeout to 10 minutes + test.setTimeout(5 * 60 * 1000); //Extending Test Case timeout to 5 minutes await page.click(pageLocators.OffChainPoll.cycle); // Click on Running Cycle Status diff --git a/tests/TC02/TC02-07_AddLambda.spec.js b/tests/TC04/TC04-04_AddLambda.spec.js similarity index 91% rename from tests/TC02/TC02-07_AddLambda.spec.js rename to tests/TC04/TC04-04_AddLambda.spec.js index 8aedc7c..1cf1022 100644 --- a/tests/TC02/TC02-07_AddLambda.spec.js +++ b/tests/TC04/TC04-04_AddLambda.spec.js @@ -3,13 +3,13 @@ const { PreProposal } = require("../CommonFile/PreAction"); const { pageLocators } = require("../CommonFile/Locator"); const { TezosTestData } = require("../CommonFile/TestData"); -test('Test case 7: Add Lambda ', async ({ page }) => { +test('Test case 4: Add Lambda ', async ({ page }) => { await PreProposal(page); //PreConditions Open URL and Open Mask DAO For Proposal try { - test.setTimeout(10 * 60 * 1000); //Extending Test Case timeout to 10 minutes + test.setTimeout(5 * 60 * 1000); //Extending Test Case timeout to 5 minutes await page.click(pageLocators.OffChainPoll.cycle); // Click on Running Cycle Status diff --git a/tests/TC02/TC02-08_RemoveLambda.spec.js b/tests/TC04/TC04-05_RemoveLambda.spec.js similarity index 91% rename from tests/TC02/TC02-08_RemoveLambda.spec.js rename to tests/TC04/TC04-05_RemoveLambda.spec.js index d033ed2..9c4a25f 100644 --- a/tests/TC02/TC02-08_RemoveLambda.spec.js +++ b/tests/TC04/TC04-05_RemoveLambda.spec.js @@ -3,13 +3,13 @@ const { PreProposal } = require("../CommonFile/PreAction"); const { pageLocators } = require("../CommonFile/Locator"); const { TezosTestData } = require("../CommonFile/TestData"); -test('Test case 8: Remove Lambda ', async ({ page }) => { - +test('Test case 5: Remove Lambda ', async ({ page }) => { + await PreProposal(page); //PreConditions Open URL and Open Mask DAO For Proposal try { - test.setTimeout(10 * 60 * 1000); //Extending Test Case timeout to 10 minutes + test.setTimeout(5 * 60 * 1000); //Extending Test Case timeout to 5 minutes await page.click(pageLocators.OffChainPoll.cycle); // Click on Running Cycle Status diff --git a/tests/TC02/TC02-09_ExecuteLambda.spec.js b/tests/TC04/TC04-06_ExecuteLambda.spec.js similarity index 76% rename from tests/TC02/TC02-09_ExecuteLambda.spec.js rename to tests/TC04/TC04-06_ExecuteLambda.spec.js index 1bc089d..cf4ac69 100644 --- a/tests/TC02/TC02-09_ExecuteLambda.spec.js +++ b/tests/TC04/TC04-06_ExecuteLambda.spec.js @@ -3,13 +3,13 @@ const { PreProposal } = require("../CommonFile/PreAction"); const { pageLocators } = require("../CommonFile/Locator"); const { TezosTestData } = require("../CommonFile/TestData"); -test('Test case 9: Execute Lambda ', async ({ page }) => { +test('Test case 6: Execute Lambda ', async ({ page }) => { + + test.setTimeout(10 * 60 * 1000); //Extending Test Case timeout to 10 minutes await PreProposal(page); //PreConditions Open URL and Open Mask DAO For Proposal try { - - test.setTimeout(10 * 60 * 1000); //Extending Test Case timeout to 10 minutes await page.click(pageLocators.OffChainPoll.cycle); // Click on Running Cycle Status @@ -17,26 +17,28 @@ test('Test case 9: Execute Lambda ', async ({ page }) => { await page.click(pageLocators.ExecuteLambda.ExecuteLambda); //Click on Execute Lambda - await page.fill(pageLocators.ExecuteLambda.SearchBox, TezosTestData.ExecuteLambda.SearchText); //Pass the Search Text + await page.click(pageLocators.ExecuteLambda.Dropdown); //Click on the DropDown - await page.waitForTimeout(1000); //Wait For Pass The Data + await page.keyboard.press('ArrowDown'); //Click on DownArrow Button await page.keyboard.press('ArrowDown'); //Click on DownArrow Button await page.keyboard.press('Enter'); //Click on Enter Button - await page.fill(pageLocators.ExecuteLambda.ExecuteLambda, TezosTestData.ExecuteLambda.LambdaArgumentsCode); //Pass The Lambda Arguments Code + await page.fill(pageLocators.ExecuteLambda.LambdaArgumentsCode, TezosTestData.ExecuteLambda.LambdaArgumentsCode); //Pass The Lambda Arguments Code + + await page.waitForTimeout(2000); await page.fill(pageLocators.ExecuteLambda.LambdaParams, TezosTestData.ExecuteLambda.LambdaParams); //Pass The Lambda Params Code await page.waitForTimeout(2000); //Wait For Validate - - const content = await page.content(); //Assume Page await page.click(pageLocators.ExecuteLambda.SubmitButton); //Click On the Submit Button await page.waitForTimeout(30000); //Wait For Pass The test Data + const content = await page.content(); //Assume Page + const isTextVisible = content.includes(pageLocators.ExecuteLambda.TransactionText, { visible: true }); //Verify that text visible on the webpage console.log(isTextVisible); //Prints True or false for is Text Visible diff --git a/tests/TC02/TC02-01_ChangeDelegate.spec.js b/tests/TC04/TC04-07_ChangeDelegate.spec.js similarity index 91% rename from tests/TC02/TC02-01_ChangeDelegate.spec.js rename to tests/TC04/TC04-07_ChangeDelegate.spec.js index ee50500..618a960 100644 --- a/tests/TC02/TC02-01_ChangeDelegate.spec.js +++ b/tests/TC04/TC04-07_ChangeDelegate.spec.js @@ -3,13 +3,13 @@ const { PreProposal } = require("../CommonFile/PreAction"); const { pageLocators } = require("../CommonFile/Locator"); const { TezosTestData } = require("../CommonFile/TestData"); -test('Test case 1: Change Delegate', async ({ page }) => { +test('Test case 7: Change Delegate', async ({ page }) => { await PreProposal(page); //PreConditions Open URL and Open Mask DAO For Proposal try { - test.setTimeout(10 * 60 * 1000); //Extending Test Case timeout to 10 minutes + test.setTimeout(5 * 60 * 1000); //Extending Test Case timeout to 5 minutes await page.click(pageLocators.OffChainPoll.cycle); // Click on Running Cycle Status diff --git a/tests/TC02/TC02-02_ChangeGuardian.spec.js b/tests/TC04/TC04-08_ChangeGuardian.spec.js similarity index 90% rename from tests/TC02/TC02-02_ChangeGuardian.spec.js rename to tests/TC04/TC04-08_ChangeGuardian.spec.js index 3aa2579..873b5c4 100644 --- a/tests/TC02/TC02-02_ChangeGuardian.spec.js +++ b/tests/TC04/TC04-08_ChangeGuardian.spec.js @@ -3,13 +3,13 @@ const { PreProposal } = require("../CommonFile/PreAction"); const { pageLocators } = require("../CommonFile/Locator"); const { TezosTestData } = require("../CommonFile/TestData"); -test('Test case 2: Change Guardian', async ({ page }) => { - +test('Test case 8: Change Guardian', async ({ page }) => { + await PreProposal(page); //PreConditions Open URL and Open Mask DAO For Proposal try { - test.setTimeout(10 * 60 * 1000); //Extending Test Case timeout to 10 minutes + test.setTimeout(5 * 60 * 1000); //Extending Test Case timeout to 5 minutes await page.click(pageLocators.OffChainPoll.cycle); // Click on Running Cycle Status @@ -36,4 +36,4 @@ test('Test case 2: Change Guardian', async ({ page }) => { console.log("Now Voting Cycle is running"); } -}) \ No newline at end of file +}) \ No newline at end of file diff --git a/tests/TC05/TC05-01_ProposalDrop.spec.js b/tests/TC05/TC05-01_ProposalDrop.spec.js new file mode 100644 index 0000000..fd2224f --- /dev/null +++ b/tests/TC05/TC05-01_ProposalDrop.spec.js @@ -0,0 +1,33 @@ +const { test, expect } = require("@playwright/test"); +const { PreProposal } = require("../CommonFile/PreAction"); +const { pageLocators } = require("../CommonFile/Locator"); +const { TezosTestData } = require("../CommonFile/TestData"); + +test('Test case 1: Drop the Active proposal', async ({ page }) => { + + test.setTimeout(10 * 60 * 1000); //Extending Test Case timeout to 10 minutes + + await PreProposal(page); //PreConditions Open URL and Open Mask DAO For Proposal + + try { + + await page.click(pageLocators.VoteOnProposal.VotingCycle); //Click on the Voting Cycle + + await page.click(pageLocators.VoteOnProposal.Active); //Click on the active Proposal + + await page.click(pageLocators.ProposalDrop.ProposalDrop); //Click on the Drop Proposal + + await page.waitForTimeout(30000); //wait for the transaction + + const content = await page.content(); //Assume Page + + const isTextVisible = content.includes(pageLocators.ProposalDrop.TransactionText, { visible: true }); //Verify that text visible on the webpage + + console.log(isTextVisible); //Prints True or false for is Text Visible + + } + catch (error) { + console.log("Error: No Proposal to drop"); + } + +}) \ No newline at end of file diff --git a/tests/TC05/TC05-01_SuccessfulTokenStaking.spec.js b/tests/TC05/TC05-01_SuccessfulTokenStaking.spec.js deleted file mode 100644 index 3fe5b15..0000000 --- a/tests/TC05/TC05-01_SuccessfulTokenStaking.spec.js +++ /dev/null @@ -1,34 +0,0 @@ -const { test, expect } = require("@playwright/test"); -const { PreTokenStaking } = require("../CommonFile/PreTokenStaking"); -const { pageLocators } = require("../CommonFile/Locator"); -const path = require('path'); - -test('Test case 1: Successful Token Staking', async ({ page }) => { - - test.setTimeout(10 * 60 * 1000); //Extending Test Case timeout to 10 minutes - - await PreTokenStaking(page); //PreConditions Open URL and Open Mask DAO For Proposal - - await page.click(pageLocators.TokenStaking.User); //Click on the User ON the Tab - - await page.click(pageLocators.TokenStaking.Deposit); //Click on the Deposit Button - - //await page.type(pageLocators.TokenStaking.PassAmount, TezosTestData.TokenStaking.Amount); //Pass The Amount - - await page.click(pageLocators.TokenStaking.UseMax); //Click onn the User Max - - await page.click(pageLocators.TokenStaking.Submit); //Click on the Submit Button - - await page.waitForTimeout(30000); //Wait for Transaction Confirmed - - const element = await page.$(pageLocators.TokenStaking.Balance); // get The element - - await page.waitForTimeout(2000); //wait for get the votes - - const textContent = await element.innerText(); //get the text From this element - - console.log(textContent); // Console The test Present on the Webpage - - console.log(" The tokens are successfully staked and and show up as available balance field"); - -}) \ No newline at end of file diff --git a/tests/TC05/TC05-02_SuccessfulTokenUnStaking.spec.js b/tests/TC05/TC05-02_SuccessfulTokenUnStaking.spec.js deleted file mode 100644 index 6e132f8..0000000 --- a/tests/TC05/TC05-02_SuccessfulTokenUnStaking.spec.js +++ /dev/null @@ -1,33 +0,0 @@ -const { test, expect } = require("@playwright/test"); -const { PreProposal } = require("../CommonFile/PreAction"); -const { pageLocators } = require("../CommonFile/Locator"); - -test('Test case 2: Successful Token UnStaking', async ({ page }) => { - - test.setTimeout(5* 60 * 1000); //Extending Test Case timeout to 10 minutes - - await PreProposal(page); //PreConditions Open URL and Open Mask DAO For Proposal - - await page.click(pageLocators.OffChainPoll.Proposal); //Click on the proposal on the Tab - - try { - - await page.click(pageLocators.ProposalExecutionAndDrop.DropProposal); // Click on Drop All Proposals - - } catch (error) { - console.log("Button not ready to be clicked") - } - - await page.waitForTimeout(5000); //Wait For Drop All The Proposal - - await page.click(pageLocators.TokenStaking.User); //Click on the User Tab - - await page.click(pageLocators.UnStakingToken.UnStakeVotes); //Click on UnStake Votes - - await page.waitForTimeout(2000); //Wait For Complete The Transaction - - const isTextVisible = content.includes(pageLocators.UnStakingToken.TransactionText, { visible: true }); //Verify that text visible on the webpage - - console.log("The tokens are successfully UnStaked and show up in the Available Balance field.") - -}) \ No newline at end of file diff --git a/tests/TC03/TC03-01_VoteOnProposal.spec.js b/tests/TC05/TC05-02_VoteOnProposal.spec.js similarity index 64% rename from tests/TC03/TC03-01_VoteOnProposal.spec.js rename to tests/TC05/TC05-02_VoteOnProposal.spec.js index 8304c9b..05335d0 100644 --- a/tests/TC03/TC03-01_VoteOnProposal.spec.js +++ b/tests/TC05/TC05-02_VoteOnProposal.spec.js @@ -1,26 +1,36 @@ const { test, expect } = require("@playwright/test"); const { PreProposal } = require("../CommonFile/PreAction"); const { pageLocators } = require("../CommonFile/Locator"); -const path = require('path'); +const { TezosTestData } = require("../CommonFile/TestData"); -test('Test case 1: Vote On On-Chain Proposal ', async ({ page }) => { +test('Test case 1: Vote On On-Chain Proposal ', async ({ page }) => { + test.setTimeout(10 * 60 * 1000); //Extending Test Case timeout to 10 minutes + await PreProposal(page); //PreConditions Open URL and Open Mask DAO For Proposal try { - test.setTimeout(10 * 60 * 1000); //Extending Test Case timeout to 10 minutes - await page.click(pageLocators.VoteOnProposal.VotingCycle); // Click on Running Cycle Status await page.click(pageLocators.VoteOnProposal.Active); //Click on the Active Button await page.click(pageLocators.VoteOnProposal.VoteFor); //Click on the Vote For Support - await page.click(pageLocators.VoteOnProposal.UseMax); //Click on Use Max + await page.fill(pageLocators.VoteOnProposal.Amount, TezosTestData.VoteOnProposal.Amount); //Fill the amount for proposal + + // await page.click(pageLocators.VoteOnProposal.UseMax); //Click on Use Max await page.click(pageLocators.VoteOnProposal.Submit); //Click on the Submit + await page.waitForTimeout(30000); //wait for the execute transaction + + const content = await page.content(); //Assume Page + + const isTextVisible = content.includes(pageLocators.VoteOnProposal.TransactionText, { visible: true }); //Verify that text visible on the webpage + + console.log(isTextVisible); //Prints True or false for is Text Visible + await page.waitForTimeout(2000); //Wait for Submit the Proposal await page.click(pageLocators.VoteOnProposal.View); //Click on the View Button diff --git a/tests/TC05/TC05-03_SuccessfulTokenWithdrawal.spec.js b/tests/TC06-01/TC06-01_TokenWithdrawal.spec.js similarity index 68% rename from tests/TC05/TC05-03_SuccessfulTokenWithdrawal.spec.js rename to tests/TC06-01/TC06-01_TokenWithdrawal.spec.js index f499ea1..96da06e 100644 --- a/tests/TC05/TC05-03_SuccessfulTokenWithdrawal.spec.js +++ b/tests/TC06-01/TC06-01_TokenWithdrawal.spec.js @@ -3,22 +3,26 @@ const { PreProposal } = require("../CommonFile/PreAction"); const { pageLocators } = require("../CommonFile/Locator"); const { TezosTestData } = require("../CommonFile/TestData"); -test('Test case 3: Successful Token Withdrawal', async ({ page }) => { +test('Test case 1: Successful Token Withdrawal', async ({ page }) => { test.setTimeout(10 * 60 * 1000); //Extending Test Case timeout to 10 minutes await PreProposal(page); //PreConditions Open URL and Open Mask DAO For Proposal - await page.click(pageLocators.TokenStaking.User); //Click On the User tab s + await page.click(pageLocators.TokenStaking.User); //Click On the User tab await page.click(pageLocators.TokenWithdrawal.Withdraw); //Click On withdrawal Button - // await page.type(pageLocators.TokenWithdrawal.Amount, TezosTestData.TokenWithdrawal.Amount); //Click On the WithDraw Amount + //await page.click(pageLocators.TokenWithdrawal.UseMax); //Click on the Use Max - await page.click(pageLocators.TokenWithdrawal.UseMax); //Click on the Use Max + await page.fill(pageLocators.TokenWithdrawal.Amount, TezosTestData.TokenWithdrawal.Amount); //fill the Amount await page.click(pageLocators.TokenWithdrawal.Submit); //Click On the Submit Button + await page.waitForTimeout(30000); //Wait for get the votes + + const content = await page.content(); //Assume Page + const isTextVisible = content.includes(pageLocators.TokenWithdrawal.TransactionText, { visible: true }); //Verify that text visible on the webpage console.log(isTextVisible); // console The Pass And Fail Result diff --git a/tests/TC06-01/TC06-02_TokenStaking.spec.js b/tests/TC06-01/TC06-02_TokenStaking.spec.js new file mode 100644 index 0000000..24c4628 --- /dev/null +++ b/tests/TC06-01/TC06-02_TokenStaking.spec.js @@ -0,0 +1,34 @@ +const { test, expect } = require("@playwright/test"); +const { PreProposal } = require("../CommonFile/PreAction"); +const { pageLocators } = require("../CommonFile/Locator"); +const { TezosTestData } = require("../CommonFile/TestData"); + +test('Test case 2: Successful Token Staking', async ({ page }) => { + + test.setTimeout(10 * 60 * 1000); //Extending Test Case timeout to 10 minutes + + await PreProposal(page); //PreConditions Open URL and Open Mask DAO For Proposal + + await page.click(pageLocators.TokenStaking.User); //Click on the User ON the Tab + + await page.click(pageLocators.TokenStaking.Deposit); //Click on the Deposit Button + + // await page.click(pageLocators.TokenStaking.UseMax); //Click onn the User Max + + await page.fill(pageLocators.TokenStaking.PassAmount, TezosTestData.TokenStaking.Amount) // fill the Amount + + await page.waitForTimeout(2000); //Wait for the type numbers in text box + + await page.click(pageLocators.TokenStaking.Submit); //Click on the Submit Button + + await page.waitForTimeout(30000); //Wait for Transaction Confirmed + + const content = await page.content(); //Assume Page + + const isTextVisible = content.includes(pageLocators.TokenStaking.TransactionText, { visible: true }); //Verify that text visible on the webpage + + console.log(isTextVisible); //Console the results of Text + + console.log("The tokens are successfully staked and and show up as available balance field"); + +}) \ No newline at end of file diff --git a/tests/TC06-02/TC06-01_ProposalExecution.spec.js b/tests/TC06-02/TC06-01_ProposalExecution.spec.js new file mode 100644 index 0000000..71f7171 --- /dev/null +++ b/tests/TC06-02/TC06-01_ProposalExecution.spec.js @@ -0,0 +1,43 @@ +const { test, expect } = require("@playwright/test"); +const { PreProposal } = require("../CommonFile/PreAction"); +const { pageLocators } = require("../CommonFile/Locator"); + +test('Test case 1: On-Chain Proposal Execution', async ({ page }) => { + test.setTimeout(10 * 60 * 1000); // Extending Test Case timeout to 10 minutes + + await PreProposal(page); // PreConditions Open URL and Open Mask DAO For Proposal + + try { + await page.click(pageLocators.OffChainPoll.cycle); // Click on Running Cycle Status + + let elementFound = false; + let retries = 0; + const maxRetries = 3; // Set the maximum number of retries as needed + + while (!elementFound && retries < maxRetries) { + try { + await page.waitForSelector(pageLocators.ProposalExecution.Execute, { timeout: 300000 }); + await page.click(pageLocators.ProposalExecution.Execute); // Click on Execute Button + elementFound = true; // Element found and clicked successfully + } catch (error) { + + console.log(`Retry ${retries + 1}: Element not found or not clickable`); // Handle the error or log it + retries++; + } + } + + if (elementFound) { + await page.waitForTimeout(30000); // Wait for transaction + + const content = await page.content(); // Assume Page + + const isTextVisible = content.includes(pageLocators.ProposalExecution.TransactionText, { visible: true }); // Verify that text is visible on the webpage + + console.log(isTextVisible); // Prints True or false for whether the text is visible + } else { + console.log(`Error: Element not found or not clickable after ${maxRetries} retries`); + } + } catch (error) { + console.log("Error: No Passed- Executable Proposals"); + } +}); diff --git a/tests/TC06-02/TC06-02_TokenUnStaking.spec.js b/tests/TC06-02/TC06-02_TokenUnStaking.spec.js new file mode 100644 index 0000000..4ffe43f --- /dev/null +++ b/tests/TC06-02/TC06-02_TokenUnStaking.spec.js @@ -0,0 +1,30 @@ +const { test, expect } = require("@playwright/test"); +const { PreProposal } = require("../CommonFile/PreAction"); +const { pageLocators } = require("../CommonFile/Locator"); + +test('Test case 2: Successful Token UnStaking ', async ({ page }) => { + + test.setTimeout(10 * 60 * 1000); //Extending Test Case timeout to 10 minutes + + await PreProposal(page); //PreConditions Open URL and Open Mask DAO For Proposal + + try { + + await page.click(pageLocators.TokenStaking.User); //Click on the User Tab + + await page.click(pageLocators.UnStakingToken.UnStakeVotes); //Click on UnStake Votes + + await page.waitForTimeout(3000); //Wait For Complete The Transaction + + const content = await page.content(); //Assume Page + + const isTextVisible = content.includes(pageLocators.UnStakingToken.TransactionText, { visible: true }); //Verify that text visible on the webpage + + console.log(isTextVisible); + + console.log("The tokens are successfully UnStaked and show up in the Available Balance field.") + + } catch (error) { + console.log("Error: No votes to unstake"); + } +}) \ No newline at end of file