diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index 3671161..af2b3b2 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -3,10 +3,10 @@ name: Run Playwright Tests on: push: branches: - - main + - dev-aayushi pull_request: branches: - - main + - dev-aayushi workflow_dispatch: permissions: @@ -52,14 +52,74 @@ jobs: - name: Install Playwright Browsers run: npx playwright install --with-deps - - name: Run Playwright tests + - name: TC01- Run Playwright tests run: npm run test:tc01 env: WEBAPP_URL: ${{ vars.WEBAPP_URL }} - - name: Deploy Report 🚀 + - name: Deploy Report for tc01🚀 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/ \ No newline at end of file + target-folder: tests/tc-01/ + + - name: TC02- Run Playwright tests + run: npm run test:tc02 + env: + WEBAPP_URL: ${{ vars.WEBAPP_URL }} + + - name: Deploy Report for tc02🚀 + uses: JamesIves/github-pages-deploy-action@v4 + with: + branch: gh-pages + folder: playwright-report # The folder the action should deploy. + target-folder: tests/tc-02/ + + - name: TC03- Run Playwright tests + run: npm run test:tc03 + env: + WEBAPP_URL: ${{ vars.WEBAPP_URL }} + + - name: Deploy Report for tc03🚀 + uses: JamesIves/github-pages-deploy-action@v4 + with: + branch: gh-pages + folder: playwright-report # The folder the action should deploy. + target-folder: tests/tc-03/ + + - name: TC04- Run Playwright tests + run: npm run test:tc04 + env: + WEBAPP_URL: ${{ vars.WEBAPP_URL }} + + - name: Deploy Report for tc04🚀 + uses: JamesIves/github-pages-deploy-action@v4 + with: + branch: gh-pages + folder: playwright-report # The folder the action should deploy. + target-folder: tests/tc-04/ + + - name: TC05- Run Playwright tests + run: npm run test:tc05 + env: + WEBAPP_URL: ${{ vars.WEBAPP_URL }} + + - name: Deploy Report for tc05🚀 + uses: JamesIves/github-pages-deploy-action@v4 + with: + branch: gh-pages + folder: playwright-report # The folder the action should deploy. + target-folder: tests/tc-05/ + + - name: TC06- Run Playwright tests + run: npm run test:tc06 + env: + WEBAPP_URL: ${{ vars.WEBAPP_URL }} + + - name: Deploy Report for tc06🚀 + uses: JamesIves/github-pages-deploy-action@v4 + with: + branch: gh-pages + folder: playwright-report # The folder the action should deploy. + target-folder: tests/tc-06/ \ No newline at end of file diff --git a/config.js b/config.js index e555dc6..747bdfd 100644 --- a/config.js +++ b/config.js @@ -1,7 +1,11 @@ -require("dotenv").config() +require ("dotenv").config() const AppConfig = { + TestURL: process.env.WEBAPP_URL + } +console.log("WEBAPP_URL:", process.env.WEBAPP_URL); + module.exports = AppConfig \ No newline at end of file diff --git a/env.example b/env.example deleted file mode 100644 index bbc5ec3..0000000 --- a/env.example +++ /dev/null @@ -1 +0,0 @@ -WEBAPP_URL=https://deploy-preview-*********.netlify.app \ No newline at end of file diff --git a/package.json b/package.json index 6688cff..05d1c5f 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,10 @@ "test": "playwright test", "test:tc01": "playwright test tests/TC01", "test:tc02": "playwright test tests/TC02", + "test:tc03": "playwright test tests/TC03", + "test:tc04": "playwright test tests/TC04", + "test:tc05": "playwright test tests/TC05", + "test:tc06": "playwright test tests/TC06", "dev": "node --inspect-brk ./node_modules/@playwright/test/cli.js test TC04DAOValues.spec.js --project=chromium --headed" }, "keywords": [], diff --git a/tests/CommonFile/Action.js b/tests/CommonFile/Action.js index 0c2a19b..e84996d 100644 --- a/tests/CommonFile/Action.js +++ b/tests/CommonFile/Action.js @@ -7,13 +7,13 @@ async function changeNetwork(page){ console.log("WebApp URL for Testing:", AppConfig.TestURL) await page.goto(AppConfig.TestURL); - await page.click(pageLocators.TokenCreator.EnterApp) + await page.click(pageLocators.TokenCreation.EnterApp) - await page.click(pageLocators.TokenCreator.MainNet); + await page.getByText(pageLocators.TokenCreation.MainNet).click() - await page.waitForSelector(pageLocators.TokenCreator.frame); + await page.waitForSelector(pageLocators.TokenCreation.frame); - await page.click(pageLocators.TokenCreator.GhostNet); + await page.getByText(pageLocators.TokenCreation.GhostNet).click(); } diff --git a/tests/CommonFile/Locator.js b/tests/CommonFile/Locator.js index 37952aa..6ac1ab0 100644 --- a/tests/CommonFile/Locator.js +++ b/tests/CommonFile/Locator.js @@ -1,171 +1,127 @@ const pageLocators = { - TokenCreator: { - MainNet:"//p[text()='Mainnet']", - GhostNet:"//h6[text()='Ghostnet']", + TokenCreation: { + MainNet: 'Mainnet', + GhostNet: "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']", - CreateDAO: "//button[@class='MuiButtonBase-root MuiButton-root MuiButton-contained jss37 jss38 MuiButton-containedSecondary']", - GovernanceToken: "//span[normalize-space()='No, I need one']", - TokenName: "//input[@placeholder='Contract Name']", - TokenDescription: "//textarea[@placeholder='Type a description']", - TotalSupply: "//input[@name='totalSupply']", - Decimals: "//input[@name='decimals']", - Symbol: "//input[@name='symbol']", - Icon: "//input[@name='icon']", - ContinueButton1: "//p[text()='Continue']", - WalletAddress: "//input[@placeholder='Wallet address']", - Amount: "//input[@placeholder='0']", - ContinueButton2: "//p[text()='Continue']", - launch: "//p[text()='Launch']", + // ConnectWallet: "//span[text()='Connect Wallet']", + CreateDAO: "Create DAO", + GovernanceToken: "No, I need one", + TokenName: "input[placeholder='Contract Name']", + TokenDescription: "textarea[placeholder='Type a description']", + TotalSupply: "input[name='totalSupply']", + Decimals: "input[name='decimals']", + Symbol: "input[name='symbol']", + Icon: "input[name='icon']", + ContinueButton: "Continue", + WalletAddress: "input[placeholder='Wallet address']", + Amount: "input[name='holders.[0].amount']", + launch: "Launch", DeployText: "Governance token successfully deployed", ConsoleAddress: "p[class='MuiTypography-root-165 MuiTypography-body1-167 MuiTypography-colorTextSecondary-191']", ErrorText: "Required", - }, - - DAOCreate: { - CreateDAO: "//span[text()='Create DAO']", - GovernanceToken: "//span[text()='Yes, I have one']", - FullDAO: "//p[normalize-space()='Full DAO']", - ContinueButton1: "//p[text()='Continue']", - DAOName: "//input[@name='name']", - TokenAddress: "//input[@name='governanceToken.address']", - TokenID: "//input[@name='governanceToken.tokenId']", - Description: "//textarea[@placeholder='Type a description']", - GuardianAddress: "//input[@placeholder='tz1PXn....']", - ContinueButton2: "//p[text()='Continue']", - VotingDays: "//input[@name='votingBlocksDay']", - VotingHours: "//input[@name='votingBlocksHours']", - VotingMinutes: "//input[@name='votingBlocksMinutes']", - ExecutionDays: "//input[@name='proposalFlushBlocksDay']", - ExecutionHours: "//input[@name='proposalFlushBlocksHours']", - ExecutionMinutes: "//input[@name='proposalFlushBlocksMinutes']", - ThresholdExpiryDays: "//input[@name='proposalExpiryBlocksDay']", - ThresholdExpiryHours: "//input[@name='proposalExpiryBlocksHours']", - ThresholdExpiryMinutes: "//input[@name='proposalExpiryBlocksMinutes']", - 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']", - ContinueButton4: "//p[text()='Continue']", - ContinueButton5: "//p[text()='Continue']", - SelfDeployed: " //p[text()='Self-Deployed']", - Managed: "//p[text()='Managed']", - DeployDAO: "//p[text()='Deploy DAO']", + ErrorText2: "Total Supply not fully allocated", + }, + + DAOCreation: { + CreateDAO: "Create DAO", + GovernanceToken: "Yes, I have one", + FullDAO: "Full DAO", + ContinueButton: "Continue", + DAOName: "input[placeholder='DAO Name']", + TokenAddress: "input[name='governanceToken.address']", + TokenID: "input[name='governanceToken.tokenId']", + GuardianAddress: "input[name='guardian']", + Description: "textarea[placeholder='Type a description']", + VotingDays: "input[name='votingBlocksDay']", + VotingHours: "input[name='votingBlocksHours']", + VotingMinutes: "input[name='votingBlocksMinutes']", + ExecutionDays: "input[name='proposalFlushBlocksDay']", + ExecutionHours: "input[name='proposalFlushBlocksHours']", + ExecutionMinutes: "input[name='proposalFlushBlocksMinutes']", + ThresholdExpiryDays: "input[name='proposalExpiryBlocksDay']", + ThresholdExpiryHours: "input[name='proposalExpiryBlocksHours']", + ThresholdExpiryMinutes: "input[name='proposalExpiryBlocksMinutes']", + RequireStake: "input[name='proposeStakeRequired']", + Slider: "span[role='slider']", + MinAmount: "input[name='minXtzAmount']", + MaxAmount: "input[name='maxXtzAmount']", + QuorumThreshold: "input[name='quorumThreshold']", + QuorumChange: "input[name='quorumChange']", + MinQuorumAmount: "input[name='minQuorumAmount']", + QuorumMaxChange: "input[name='quorumMaxChange']", + MaxQuorumAmount: "input[name='maxQuorumAmount']", + SelfDeployed: " Self-Deployed", + DeployDAO: "Deploy DAO", + // Managed: "//p[text()='Managed']", DAOText: "Go to my DAO", ErrorText: "Required", }, + ProposalCreation: { + Search: "input[placeholder='Search']", + ExampleDAO: "Example DAO", + Proposal: "//p[text()='Proposals']", + Cycle: "Creating", + NewProposal: "New Proposal", + + }, + DAOConfiguration: { - DAOConfiguration: "//p[text()='DAO Configuration']", - ProposalFee: "input[placeholder='Proposal fee']", - ReturnedTokenPercentage: "input[placeholder='Returned tokens percentage']", - SubmitButton: "//span[text()='Submit']", + DAOConfiguration: "DAO Configuration", + ProposalFee: "input[name='frozen_extra_value']", + ReturnedTokenPercentage: "input[name='returnedPercentage']", + SubmitButton: "Submit", }, ChangeGuardian: { - ChangeGuardian: "//p[text()='Change Guardian']", + ChangeGuardian: "Change Guardian", WalletAddress: "input[placeholder=' tz1...']", - SubmitButton: '//span[text()="Submit"]', + SubmitButton: 'Submit', + validateText: 'Guardian change proposal transaction confirmed' }, ChangeDelegate: { - ChangeDelegate: "//p[text()='Change Delegate']", + ChangeDelegate: "Change Delegate", NewDelegateAddress: "input[placeholder=' tz1...']", - SubmitButton: "//span[text()='Submit']", + SubmitButton: "Submit", PopUp: "", }, TransferToken: { - Treasury: "//p[text()='Treasury']", - NewTransfer: "//span[text()='New Transfer']", + Treasury: "Treasury", + NewTransfer: "New Transfer", Recipient: "input[placeholder='Type an Address Here']", - Asset: "//input[@class='MuiInputBase-input MuiInput-input MuiAutocomplete-input MuiAutocomplete-inputFocused MuiInputBase-inputAdornedEnd']", + Asset: "input[class='MuiInputBase-input MuiInput-input MuiAutocomplete-input MuiAutocomplete-inputFocused MuiInputBase-inputAdornedEnd']", + TST: "TST", Amount: "input[placeholder='0']", AgoraPostID: "input[placeholder='Type an Agora Post ID']", - SubmitButton: "//span[normalize-space()='Submit']", - TransactionText: "Registry proposal transaction confirmed", + SubmitButton: "Submit", + verifyText: "Registry proposal transaction confirmed", }, TransferNFT: { - NFTs: "//span[text()='NFTs']", + NFTs: "NFTs", + NFTid: "input[class='MuiInputBase-input MuiInput-input MuiAutocomplete-input MuiAutocomplete-inputFocused MuiInputBase-inputAdornedEnd']" }, EditRegistry: { - Registry: "//p[text()='Registry']", - NewItem: "//span[text()='New Item']", - BatchTransfer: "//input[@type='checkbox']", - Key: "//input[@placeholder='Type a Key']", - Value: "//textarea[@placeholder='Type a value']", - Submit: "//span[text()='Submit']", - + Registry: "Registry", + NewItem: "New Item", + Key: "input[placeholder='Type a Key']", + Value: "textarea[placeholder='Type a value']", + verifyText: "Registry proposal transaction confirmed!" }, - AddLambda: { - AddLambda: "//p[text()='Add Lambda']", - TestBox: ".npm__react-simple-code-editor__textarea", - SubmitButton: "//span[text()='Submit']", - - }, - - RemoveLambda: { - RemoveLambda: "//p[text()='Remove Lambda']", - SearchBox: "#combo-box-demo", - SubmitButton: "//span[text()='Submit']", - - }, - - 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 ', - SubmitButton: "//span[text()='Submit']", - }, - - VoteOnProposal: { - VotingCycle: "//p[text()='Creating']", - OnChainButton: "//button[@class='MuiButtonBase-root MuiButton-root MuiButton-text jss417']", - Active: "//p[text()='Active']", - Pending: "//p[text()='Pending']", - VoteFor: "//span[text()='Vote For']", - VoteAgainst: "//span[text()='Vote Against']", - UseMax: "//p[text()='Use Max']", - 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", - - }, - - ProposalExecutionAndDrop: { - PassedExecutable: "//p[text()='Passed - Executable']", - Passed: "//p[text()='Passed']", - NoQuorum: "//p[text()='No Quorum']", - Expired: "//p[text()='Expired']", - DropProposal: "//span[text()='Drop Proposal']", - PercentageText: "//p[@class='MuiTypography-root jss1339 jss1340 MuiTypography-body1']", - DropExpired: "//span[text()='Drop Expired']", - Execute: "//span[text()='Execute']", - }, OffChainPoll: { - ExampleDAO: "//p[text()='Example DAO']", - Proposal: "//p[text()='Proposals']", - cycle: "//p[text()='Creating']", - NewProposal: "//span[text()='New Proposal']", - OffChainPoll: "//p[text()='Off Chain Poll']", + NewProposal: "New Proposal", + OffChainPoll: "Off Chain Poll", ProposalTitle: "input[placeholder='Proposal Title*']", - ShortDescription: "textarea[placeholder='Short description']", + Description: "textarea[placeholder='Short description']", ExternalLink: "input[placeholder='External Link']", multipleChoice: "input[value='1']", Choice1: "input[placeholder='Choice 1']", @@ -175,47 +131,64 @@ const pageLocators = { 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!']", + CreateProposalButton: "Create Proposal", + CreateText: "Proposal created!", }, VoteOnOffChainPoll: { - ProposalName: "//h4[text()='Community Governance Upgrades Poll']", - Option1: "//p[text()='Introduce Liquid Democracy']", - Option2: "//p[text()='Increase Proposal Exploration Period']", - CastYourVote: "//span[text()='Cast your vote']", - VoteDone: "Your vote has been submitted", + ProposalName: "Testing Proposal", + Option1: "option1", + Option2: "option2", + CastYourVote: "Cast your vote", + VoteVerify: "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']", - Option1: "div[class='MuiGrid-root jss342 jss373 jss372 MuiGrid-container MuiGrid-direction-xs-column'] 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'] p[class='MuiTypography-root MuiTypography-body2 MuiTypography-colorTextPrimary']", - Option2: "div[class='MuiGrid-root jss342 jss374 jss372 MuiGrid-container MuiGrid-direction-xs-column'] 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'] p[class='MuiTypography-root MuiTypography-body2 MuiTypography-colorTextPrimary']", - + 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']" }, - 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", + VotingOnChain: { + active: 'Active', + VoteFor: 'Vote For', + VoteAgainst: 'Vote Against', + Amount: 'input[placeholder="Type an Amount"]', + Submit: 'Submit', + validateText: 'Vote transaction confirmed!', + View: 'View', }, - UnStakingToken: { - UnStakeVotes: "//span[text()='Unstake Votes']", - TransactionText: "Execute transaction confirmed", + ProposalExecutionandDrop: { + PassedExecutable: "Passed - Executable", + Passed: "Passed", + DropProposal: "Drop Proposal", + PercentageText: "p[class='MuiTypography-root jss1339 jss1340 MuiTypography-body1']", + DropExpired: "Drop Expired", + Execute: "Execute", }, + TokenDeposit: { + User: "User", + Deposit: "Deposit", + Amount: "input[placeholder='0']", + Submit: "Submit", + verifyText: "Deposit transaction confirmed!", + Balance: ".MuiTypography-root jss2800 MuiTypography-body1 MuiTypography-colorTextPrimary" + + }, TokenWithdrawal: { - Withdraw: "//span[text()='Withdraw']", - Amount: "//input[@placeholder='0']", - UseMax: "//p[text()='Use Max']", - Submit: "//span[text()='Submit']", - TransactionText: "Withdrawal transaction confirmed", - } + User: "User", + Withdraw: "Withdraw", + Amount: "input[placeholder='0']", + Submit: "Submit", + verifyText: "Withdrawal transaction confirmed!" + }, + TokenUnstaking: { + Drop: "Drop Expired", + User: "User", + Unstake: "Unstake Votes", + verifyText: "Execute transaction confirmed!" + }, }; export { pageLocators }; diff --git a/tests/CommonFile/PreAction.js b/tests/CommonFile/PreAction.js deleted file mode 100644 index 6fdb156..0000000 --- a/tests/CommonFile/PreAction.js +++ /dev/null @@ -1,18 +0,0 @@ -const { test } = require("@playwright/test"); -const { pageLocators } = require ("./Locator"); -const { changeNetwork } = require("./Action"); - -async function PreProposal(page){ - - await changeNetwork(page); //PreConditions Open URL and Selecting the Ghost-net - - await page.click(pageLocators.OffChainPoll.ExampleDAO); //Click on Mask DAO - - await page.click(pageLocators.OffChainPoll.Proposal); //Click on Proposal - -} - - -module.exports= { - PreProposal -} \ No newline at end of file diff --git a/tests/CommonFile/PreProposal.js b/tests/CommonFile/PreProposal.js new file mode 100644 index 0000000..6e347ce --- /dev/null +++ b/tests/CommonFile/PreProposal.js @@ -0,0 +1,27 @@ +const { test } = require("@playwright/test"); +const { pageLocators } = require ("./Locator"); +const { changeNetwork } = require("./Action"); + +async function PreProposal(page){ + + + //To extend the time of test execution + test.setTimeout(120000); + + //Open URL and Selecting the Ghost-net + await changeNetwork(page); + + // Select Example DAO + await page.locator(pageLocators.ProposalCreation.Search).type("Example") + + await page.getByText(pageLocators.ProposalCreation.ExampleDAO).click(); + + // Click Proposals + await page.click(pageLocators.ProposalCreation.Proposal) + +} + + +module.exports= { + PreProposal +} \ No newline at end of file diff --git a/tests/CommonFile/TestData.js b/tests/CommonFile/TestData.js index b66df97..55873ae 100644 --- a/tests/CommonFile/TestData.js +++ b/tests/CommonFile/TestData.js @@ -1,24 +1,27 @@ const TezosTestData = { - TokenCreator: { + TokenCreation: { TokenName: "My token name", TokenDescription: "My Token Descriptions", - TC02TokenDescription: "", + TC01_02TokenDescription: "", SupplyToken: "100", Decimals: "18", Symbol: "#", Icon: "Picture.PNG", WalletAddress: "tz1LCFwczMiEuNHcMvpqgNzzEs8f4FNBgyNK", Amount: "100", + TC01_03Amount: "10", + }, - DAOCreate: { - DAOName: "Decentralized Governance Initiative", - TokenAddress: "KT1EHxvnhn5gX9EcNyFsp3y1HnKCBM2JjXpm", + DAOCreation: { + DAOName: "My Test DAO", + TokenAddress: "KT1ND3pDj67PqfjvzqPUAvSRqmcqcHnqpiEQ", + TokenAddress2:"KT1BERTLG7JzpzWcT5UMVZFe4gC2cv9BhKMM", TokenID: "0", GuardianAddress: "tz1LCFwczMiEuNHcMvpqgNzzEs8f4FNBgyNK", Description: "A DAO focused on funding and promoting open-source projects related to sustainability and renewable energy.", - TC04DAODescription: "", + TC02_02DAODescription: "", VotingDays: '00', VotingHours: '01', VotingMinutes: "00", @@ -26,7 +29,7 @@ const TezosTestData = { ExecutionHours: "00", ExecutionMinutes: "01", ThresholdExpiryDays: "01", - ThresholdExpiryHours: "00", + ThresholdExpiryHours: "01", ThresholdExpiryMinutes: "00", QuorumThreshold: '2', QuorumChange: '2', @@ -38,86 +41,59 @@ const TezosTestData = { MaxAmount: "20", }, + OffChainPoll: { + ProposalTitle: "Testing proposal", + Description: "This proposal aims to conduct an off-chain poll.", + ExternalLink: "https://example.com", + Choice1: "option1", + Choice2: "option2", + DD: "01", + HH: "02", + MM: "05", + }, + DAOConfiguration: { ProposalFee: "1", - ReturnedTokenPercentage: "1", + ReturnedTokenPercentage: "2", }, ChangeGuardian: { - WalletAddress: "tz1VxgGHwU6T6MaWrzfCBSpg2tw823KWVbk6", + WalletAddress: "tz1LCFwczMiEuNHcMvpqgNzzEs8f4FNBgyNK", }, ChangeDelegate: { - NewDelegateAddress: "tz1VxgGHwU6T6MaWrzfCBSpg2tw823KWVbk6", + NewDelegateAddress: "tz1LCFwczMiEuNHcMvpqgNzzEs8f4FNBgyNK", }, TransferToken: { - RecipientAddress: "tz1VxgGHwU6T6MaWrzfCBSpg2tw823KWVbk6", - Asset: "SRD", - Amount: "10", - AgoraPostID: "10", + RecipientAddress: "tz1LCFwczMiEuNHcMvpqgNzzEs8f4FNBgyNK", + Asset: "TST", + Amount: "05", + AgoraPostID: "5", }, - TransferNFT: { - - }, EditRegistry: { - Key: "Hello", - Value: "Hi", + Key: "This is Registry", + Value: "Helloo", }, - AddLambda: { - MichelsonCode: ".npm__react-simple-code-editor__textarea", - + VotingOnChain: { + Amount: '25584', }, - RemoveLambda: { - SearchText: "transfer_proposal", - }, - - 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: { - - }, - - ProposalExecutionAndDrop: { - Execute: "//span[text()='Execute']", - DropExpired: "//span[text()='Drop Expired']", - }, - - - OffChainPoll: { - ProposalTitle: "Community Governance Upgrades Poll", - 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" + TokenDeposit: { + Amount: "2", + Balance: "2" }, TokenWithdrawal: { - Amount: "23456E_+", - }, - - + Amount: "5", + } } export { TezosTestData }; \ 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 b1a6134..e59e95d 100644 --- a/tests/TC01/TC01-01_CreateToken.spec.js +++ b/tests/TC01/TC01-01_CreateToken.spec.js @@ -1,54 +1,70 @@ -const { test } = require("@playwright/test"); +const { test, expect } = require("@playwright/test"); const { changeNetwork } = require("../CommonFile/Action"); const { pageLocators } = require("../CommonFile/Locator"); const { TezosTestData } = require("../CommonFile/TestData");+ -test("Test Case 1: Successful Token Creation", async ({ page }) => { +test("Test Case 01-01: Successful Token Creation", async ({ page }) => { - console.log('Extending Test Case timeout to 10 minutes') - test.setTimeout(10 * 60* 1000); //To extend the time of test execution + //To extend the time of test execution + test.setTimeout(120000); - await changeNetwork(page); //PreConditions Open URL and Selecting the Ghost-net + //Open URL and Selecting the Ghost-net + await changeNetwork(page); - await page.click(pageLocators.TokenCreator.CreateDAO); //Select A Create New DAO + //Select A Create New DAO + await page.getByText(pageLocators.TokenCreation.CreateDAO).click(); - await page.click(pageLocators.TokenCreator.GovernanceToken); //Selecting the Governance Token + //Selecting the Governance Token + await page.getByText(pageLocators.TokenCreation.GovernanceToken).click(); - await page.fill(pageLocators.TokenCreator.TokenName, TezosTestData.TokenCreator.TokenName); //Pass The Token Name + //Pass The Token Name + await page.fill(pageLocators.TokenCreation.TokenName, TezosTestData.TokenCreation.TokenName); - await page.fill(pageLocators.TokenCreator.TokenDescription, TezosTestData.TokenCreator.TokenDescription); //Pass The Token Description + //Pass The Token Description + await page.fill(pageLocators.TokenCreation.TokenDescription, TezosTestData.TokenCreation.TokenDescription); - await page.fill(pageLocators.TokenCreator.TotalSupply, TezosTestData.TokenCreator.SupplyToken); //Total Supply of Tokens + //Total Supply of Tokens + await page.fill(pageLocators.TokenCreation.TotalSupply, TezosTestData.TokenCreation.SupplyToken); - await page.fill(pageLocators.TokenCreator.Decimals, TezosTestData.TokenCreator.Decimals); //Pass The Decimals + //Pass The Decimals + await page.fill(pageLocators.TokenCreation.Decimals, TezosTestData.TokenCreation.Decimals); - await page.fill(pageLocators.TokenCreator.Symbol, TezosTestData.TokenCreator.Symbol); //Pass The Symbol for token + //Pass The Symbol for token + await page.fill(pageLocators.TokenCreation.Symbol, TezosTestData.TokenCreation.Symbol); - await page.fill(pageLocators.TokenCreator.Icon, TezosTestData.TokenCreator.Icon); //Pass The Icon for Token + //Pass The Icon for Token + await page.fill(pageLocators.TokenCreation.Icon, TezosTestData.TokenCreation.Icon); - await page.click(pageLocators.TokenCreator.ContinueButton1); //Click On Continue Button + //Click On Continue Button + await page.getByText(pageLocators.TokenCreation.ContinueButton).click(); - await page.fill(pageLocators.TokenCreator.WalletAddress, TezosTestData.TokenCreator.WalletAddress); //Pass The Wallet Address + //Pass The Wallet Address + await page.fill(pageLocators.TokenCreation.WalletAddress, TezosTestData.TokenCreation.WalletAddress); - await page.fill(pageLocators.TokenCreator.Amount, TezosTestData.TokenCreator.Amount); //Pass The Amount + //Pass The Amount + await page.fill(pageLocators.TokenCreation.Amount, TezosTestData.TokenCreation.Amount); - await page.click(pageLocators.TokenCreator.ContinueButton2); //Click on Continue Button + //Click on Continue Button + await page.getByText(pageLocators.TokenCreation.ContinueButton).click(); - await page.click(pageLocators.TokenCreator.launch); //Click on launch button + //Click on launch button + await page.getByText(pageLocators.TokenCreation.launch).click(); - await page.waitForTimeout(30000); //Wait for the Token Create + //Wait for the Token Create + await page.waitForTimeout(30000); - const content = await page.content(); //Assume Page + // Check whether Deploy text is visible + const content = await page.getByText(pageLocators.TokenCreation.DeployText); + await expect(content).toBeVisible; + + //Wait for find the Element + await page.waitForSelector(pageLocators.TokenCreation.ConsoleAddress); - const isTextVisible = content.includes(pageLocators.TokenCreator.DeployText, { visible: true }); //Verify that text visible on the webpage - - await page.waitForSelector(pageLocators.TokenCreator.ConsoleAddress); //Wait for find the Element - - const element = await page.$(pageLocators.TokenCreator.ConsoleAddress); // get The element + const element = await page.$(pageLocators.TokenCreation.ConsoleAddress); // get The element const textContent = await element.innerText(); //get the text From this element console.log('Token Address:', textContent); // Console The test Present on the Webpage - console.log("The token is successfully created and the user is redirected to a confirmation page with the details of the newly created token."); + console.log("The token is successfully created and the user is redirected to a confirmation page."); }); diff --git a/tests/TC01/TC01-02_TokenValues.spec.js b/tests/TC01/TC01-02_TokenValues.spec.js deleted file mode 100644 index 5a6fb65..0000000 --- a/tests/TC01/TC01-02_TokenValues.spec.js +++ /dev/null @@ -1,38 +0,0 @@ -const { test, expect } = require("@playwright/test"); -const { changeNetwork } = require("../CommonFile/Action"); -const { pageLocators } = require("../CommonFile/Locator"); -const { TezosTestData } = require("../CommonFile/TestData"); - -test("Test Case 2: Token Creation with Various Input Values", async ({ page, }) => { - - test.setTimeout(600000); //To extend the time of test execution - - await changeNetwork(page); //PreConditions Open URL and selecting the Ghost-net - - await page.click(pageLocators.TokenCreator.CreateDAO); //Select A Create New DAO - - await page.click(pageLocators.TokenCreator.GovernanceToken); //Selecting the Governance Token - - await page.fill(pageLocators.TokenCreator.TokenName, TezosTestData.TokenCreator.TokenName); //Pass The Token Name - - await page.fill(pageLocators.TokenCreator.TokenDescription, TezosTestData.TokenCreator.TC02TokenDescription); //Pass The Token Description - - await page.fill(pageLocators.TokenCreator.TotalSupply, TezosTestData.TokenCreator.SupplyToken); //Total Supply of Tokens - - await page.fill(pageLocators.TokenCreator.Decimals, TezosTestData.TokenCreator.Decimals); //Pass The Decimals - - await page.fill(pageLocators.TokenCreator.Symbol, TezosTestData.TokenCreator.Symbol); //Pass The Symbol for token - - await page.fill(pageLocators.TokenCreator.Icon, TezosTestData.TokenCreator.Icon); //Pass The Icon for Token - - await page.click(pageLocators.TokenCreator.ContinueButton1); //Click On Continue Button - - const textMessage = page.getByText(pageLocators.TokenCreator.ErrorText); //Get The Text - - console.log(textMessage); //Console The Results - - await expect(textMessage).toBeVisible(); //Verify The Text Present on The Web - - console.log(" Create Token with input values are fail due to the decimals test box not accept 0 value"); - -}); diff --git a/tests/TC01/TC01-02_TokenWithValues.spec.js b/tests/TC01/TC01-02_TokenWithValues.spec.js new file mode 100644 index 0000000..1b36abe --- /dev/null +++ b/tests/TC01/TC01-02_TokenWithValues.spec.js @@ -0,0 +1,50 @@ +const { test, expect } = require("@playwright/test"); +const { changeNetwork } = require("../CommonFile/Action"); +const { pageLocators } = require("../CommonFile/Locator"); +const { TezosTestData } = require("../CommonFile/TestData"); + +test("Test Case 01-02: Token Creation with Various Input Values", async ({ page, }) => { + + //To extend the time of test execution + test.setTimeout(120000); + + //Open URL and Selecting the Ghost-net + await changeNetwork(page); + + //Select A Create New DAO + await page.getByText(pageLocators.TokenCreation.CreateDAO).click(); + + //Selecting the Governance Token + await page.getByText(pageLocators.TokenCreation.GovernanceToken).click(); + + //Pass The Token Name + await page.fill(pageLocators.TokenCreation.TokenName, TezosTestData.TokenCreation.TokenName); + + //Pass The Token Description + await page.fill(pageLocators.TokenCreation.TokenDescription, TezosTestData.TokenCreation.TC01_02TokenDescription); + + //Total Supply of Tokens + await page.fill(pageLocators.TokenCreation.TotalSupply, TezosTestData.TokenCreation.SupplyToken); + + //Pass The Decimals + await page.fill(pageLocators.TokenCreation.Decimals, TezosTestData.TokenCreation.Decimals); + + //Pass The Symbol for token + await page.fill(pageLocators.TokenCreation.Symbol, TezosTestData.TokenCreation.Symbol); + + //Pass The Icon for Token + await page.fill(pageLocators.TokenCreation.Icon, TezosTestData.TokenCreation.Icon); + + //Click On Continue Button + await page.getByText(pageLocators.TokenCreation.ContinueButton).click(); + + //Get error the text + const textMessage = page.getByText(pageLocators.TokenCreation.ErrorText); + + //Verify The Text Present on The Web + await expect(textMessage).toBeVisible(); + + console.log(textMessage); + console.log("Create Token with input values failed because description test box does not accept empty string"); + +}); diff --git a/tests/TC01/TC01-03_CreateDAO.spec.js b/tests/TC01/TC01-03_CreateDAO.spec.js deleted file mode 100644 index 7444052..0000000 --- a/tests/TC01/TC01-03_CreateDAO.spec.js +++ /dev/null @@ -1,108 +0,0 @@ -const { test, expect } = require('@playwright/test'); -const { changeNetwork } = require("../CommonFile/Action"); -const { pageLocators } = require("../CommonFile/Locator"); -const { TezosTestData } = require("../CommonFile/TestData"); - -test('Test Case 3 : Create DAO Successfully', async ({ page }) => { - - test.setTimeout(600000); //To extend the time of test execution - - await changeNetwork(page); //PreConditions Open URL and Selecting the Ghost-net - - await page.click(pageLocators.DAOCreate.CreateDAO); //Click on Create DAO - - await page.click(pageLocators.DAOCreate.GovernanceToken); //Selecting Governance (Yes, I Have one) - - await page.click(pageLocators.DAOCreate.FullDAO); //Click on FullDAO - - await page.click(pageLocators.DAOCreate.ContinueButton1); //Click On Continue - - 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.TokenID, TezosTestData.DAOCreate.TokenID); //Fill Token ID - - await page.fill(pageLocators.DAOCreate.GuardianAddress, TezosTestData.DAOCreate.GuardianAddress); //Fill The Wallet Address - - await page.fill(pageLocators.DAOCreate.Description, TezosTestData.DAOCreate.Description); //Fill The Description - - 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 - - await page.fill(pageLocators.DAOCreate.VotingMinutes, TezosTestData.DAOCreate.VotingMinutes); //Pass The Voting Minutes Duration - - await page.fill(pageLocators.DAOCreate.ExecutionDays, TezosTestData.DAOCreate.ExecutionDays); //Pass The Proposal Execution Days Duration - - await page.fill(pageLocators.DAOCreate.ExecutionHours, TezosTestData.DAOCreate.ExecutionHours); //Pass The Proposal Execution Hours Duration - - await page.fill(pageLocators.DAOCreate.ExecutionMinutes, TezosTestData.DAOCreate.ExecutionMinutes); //Pass The Proposal Execution Minutes Duration - - await page.fill(pageLocators.DAOCreate.ThresholdExpiryDays, TezosTestData.DAOCreate.ThresholdExpiryDays); //Pass The Proposal Expiry Threshold Days Duration - - await page.fill(pageLocators.DAOCreate.ThresholdExpiryHours, TezosTestData.DAOCreate.ThresholdExpiryHours); //Pass The Proposal Expiry Threshold Hours Duration - - await page.fill(pageLocators.DAOCreate.ThresholdExpiryMinutes, TezosTestData.DAOCreate.ThresholdExpiryMinutes); //Pass The Proposal Expiry Threshold Minutes Duration - - await page.fill(pageLocators.DAOCreate.RequireStake, TezosTestData.DAOCreate.RequiredStake); //Fill Required Stake - - const slider = page.locator(pageLocators.DAOCreate.Slider); //Locate The Slider - - const targetPosition = { x: 50, y: 0 }; // Replace with the desired target position. - - await slider.scrollIntoViewIfNeeded(); // Ensure the slider is in view - - const sliderBoundingBox = await slider.boundingBox(); // Get the bounding box of the slider for dragging - - const targetX = sliderBoundingBox.x + targetPosition.x; // Calculate the target position based on the slider's bounding box - - const targetY = sliderBoundingBox.y + targetPosition.y; - - await page.mouse.move(sliderBoundingBox.x, sliderBoundingBox.y); // Create a mouse action context and perform the drag and drop - - await page.mouse.down(); - - await page.mouse.move(targetX, targetY, { steps: 50 }); // You can adjust the number of steps for smoother animation - - await page.mouse.up(); - - await page.fill(pageLocators.DAOCreate.MinAmount, TezosTestData.DAOCreate.MinAmount); //Pass Min Transfer Amount - - await page.fill(pageLocators.DAOCreate.MaxAmount, TezosTestData.DAOCreate.MaxAmount); //Pass Max Transfer Amount - - await page.click(pageLocators.DAOCreate.ContinueButton3); //Click On Continue - - await page.fill(pageLocators.DAOCreate.QuorumThreshold, TezosTestData.DAOCreate.QuorumThreshold); //Pass The Initial Quorum Threshold - - await page.fill(pageLocators.DAOCreate.QuorumChange, TezosTestData.DAOCreate.QuorumChange); //Pass The Initial Quorum Change - - await page.fill(pageLocators.DAOCreate.MinQuorumAmount, TezosTestData.DAOCreate.MinQuorumAmount); //Pass The Min. Quorum Threshold - - await page.fill(pageLocators.DAOCreate.QuorumMaxChange, TezosTestData.DAOCreate.QuorumChange); //Pass The Max. Quorum Change - - await page.fill(pageLocators.DAOCreate.MaxQuorumAmount, TezosTestData.DAOCreate.MaxQuorumAmount); //Pass The Max. Quorum Threshold - - await page.waitForTimeout(1000); //Wait for the Page Load - - await page.click(pageLocators.DAOCreate.ContinueButton4); //Click On Continue - - await page.waitForTimeout(1000); //Wait For The Page Load - - await page.click(pageLocators.DAOCreate.ContinueButton5); //Click On Continue - - await page.click(pageLocators.DAOCreate.SelfDeployed); //Click On Self Deployed - - await page.click(pageLocators.DAOCreate.DeployDAO); //Click On Launch - - await page.waitForTimeout(60000); //Wait for Deploy the DAO - - const content = await page.content(); //Assume Page - - const isTextVisible = content.includes(pageLocators.DAOCreate.DAOText, { visible: true }); //Verify that text visible on the webpage - - 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-03_TokenWithValues.spec.js b/tests/TC01/TC01-03_TokenWithValues.spec.js new file mode 100644 index 0000000..4058175 --- /dev/null +++ b/tests/TC01/TC01-03_TokenWithValues.spec.js @@ -0,0 +1,57 @@ +const {test, expect} = require('@playwright/test'); +const { changeNetwork } = require('../CommonFile/Action'); +const { pageLocators } = require("../CommonFile/Locator"); +const { TezosTestData } = require("../CommonFile/TestData"); + + +test('Test Case 01-03: Amount Less than Supply Token',async ({page})=>{ + + //To extend the time of test execution + test.setTimeout(120000); + + //Open URL and Selecting the Ghost-net + await changeNetwork(page); + + //Click Create DAO button + await page.getByText(pageLocators.TokenCreation.CreateDAO).click(); + + //click "No, I need one" + await page.getByText(pageLocators.TokenCreation.GovernanceToken).click(); + + //Enter token name + await page.fill(pageLocators.TokenCreation.TokenName, TezosTestData.TokenCreation.TokenName); + + //Enter token description + await page.fill(pageLocators.TokenCreation.TokenDescription, TezosTestData.TokenCreation.TokenDescription) + //Enter Supply + await page.fill(pageLocators.TokenCreation.TotalSupply, TezosTestData.TokenCreation.SupplyToken) + //Enter Decimals + await page.fill(pageLocators.TokenCreation.Decimals, TezosTestData.TokenCreation.Decimals) + //Enter Icon + await page.fill(pageLocators.TokenCreation.Icon, TezosTestData.TokenCreation.Icon) + //Enter Symbol + await page.fill(pageLocators.TokenCreation.Symbol, TezosTestData.TokenCreation.Symbol) + + // Click Continue + await page.getByText(pageLocators.TokenCreation.ContinueButton).click(); + + //Enter Wallet Address + await page.fill(pageLocators.TokenCreation.WalletAddress, TezosTestData.TokenCreation.WalletAddress); + + //Enter The Amount + await page.fill(pageLocators.TokenCreation.Amount, TezosTestData.TokenCreation.TC01_03Amount); + + //Click on Continue Button + await page.getByText(pageLocators.TokenCreation.ContinueButton).click(); + + //Get error message + const errorText = await page.getByText(pageLocators.TokenCreation.ErrorText2); + await expect(errorText).toBeVisible(); + + console.log("message shown: ",TezosTestData.TokenCreation.ErrorText2); + console.log("Create Token with input values failed because amount cannot be less than or greater than supply."); + + await page.waitForTimeout(5000); + + +}) \ No newline at end of file diff --git a/tests/TC01/TC01-04_DAOValues.spec.js b/tests/TC01/TC01-04_DAOValues.spec.js deleted file mode 100644 index 445b022..0000000 --- a/tests/TC01/TC01-04_DAOValues.spec.js +++ /dev/null @@ -1,40 +0,0 @@ -const { test, expect } = require('@playwright/test'); -const { changeNetwork } = require("../CommonFile/Action"); -const { pageLocators } = require("../CommonFile/Locator"); -const { TezosTestData } = require("../CommonFile/TestData"); - -test('Test Case 4 : Create DAO with various input values', async ({ page }) => { - - test.setTimeout(600000); //To extend the time of test execution - - await changeNetwork(page); //PreConditions Open URL and Selecting the Ghost-net - - await page.click(pageLocators.DAOCreate.CreateDAO); //Click on Create DAO - - await page.click(pageLocators.DAOCreate.GovernanceToken); //Selecting Governance (Yes, I Have one) - - await page.click(pageLocators.DAOCreate.FullDAO); //Click on FullDAO - - await page.click(pageLocators.DAOCreate.ContinueButton1); //Click On Continue - - 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.TokenID, TezosTestData.DAOCreate.TokenID); //Fill Token ID - - await page.fill(pageLocators.DAOCreate.GuardianAddress, TezosTestData.DAOCreate.GuardianAddress); //Fill The Wallet Address - - await page.fill(pageLocators.DAOCreate.Description, TezosTestData.DAOCreate.TC04DAODescription); //Fill The Description - - await page.click(pageLocators.DAOCreate.ContinueButton2); //Click on Continue - - const errorMessage = page.getByText(pageLocators.DAOCreate.ErrorText); //Get The Text - - console.log(errorMessage) //Show The Result - - await expect(errorMessage).toBeVisible(); //Verify The Text Shows Description is Required - - console.log("The system handles the input appropriately, either creating the DAO or displaying an error message."); - -}) \ No newline at end of file diff --git a/tests/TC02/TC02-01_CreateDAO.spec.js b/tests/TC02/TC02-01_CreateDAO.spec.js new file mode 100644 index 0000000..a1927c6 --- /dev/null +++ b/tests/TC02/TC02-01_CreateDAO.spec.js @@ -0,0 +1,150 @@ +const { test, expect } = require('@playwright/test'); +const { changeNetwork } = require("../CommonFile/Action"); +const { pageLocators } = require("../CommonFile/Locator"); +const { TezosTestData } = require("../CommonFile/TestData"); + +test('Test Case 02-01 : Create DAO Successfully', async ({ page }) => { + + //To extend the time of test execution + test.setTimeout(120000); + + //Open URL and Selecting the Ghost-net + await changeNetwork(page); + + //Click on Create DAO + await page.getByText(pageLocators.DAOCreation.CreateDAO).click(); + + //Selecting Yes, I Have one + await page.getByText(pageLocators.DAOCreation.GovernanceToken).click(); + + //Click on FullDAO + await page.getByText(pageLocators.DAOCreation.FullDAO).click(); + + //Click On Continue + await page.getByText(pageLocators.DAOCreation.ContinueButton).click(); + + //Fill DAO Name + await page.fill(pageLocators.DAOCreation.DAOName, TezosTestData.DAOCreation.DAOName); + + //Fill Token Address + await page.fill(pageLocators.DAOCreation.TokenAddress, TezosTestData.DAOCreation.TokenAddress); + + //Fill Token ID + await page.fill(pageLocators.DAOCreation.TokenID, TezosTestData.DAOCreation.TokenID); + + //Fill The Wallet Address + await page.fill(pageLocators.DAOCreation.GuardianAddress, TezosTestData.DAOCreation.GuardianAddress); + + //Fill The Description + await page.fill(pageLocators.DAOCreation.Description, TezosTestData.DAOCreation.Description); + + //Click on Continue + await page.getByText(pageLocators.DAOCreation.ContinueButton).click(); + + //Pass The Voting Cycle Days Duration + await page.fill(pageLocators.DAOCreation.VotingDays, TezosTestData.DAOCreation.VotingDays); + + //Pass The Voting Cycle Hours Duration + await page.fill(pageLocators.DAOCreation.VotingHours, TezosTestData.DAOCreation.VotingHours); + + //Pass The Voting Minutes Duration + await page.fill(pageLocators.DAOCreation.VotingMinutes, TezosTestData.DAOCreation.VotingMinutes); + + //Pass The Proposal Execution Days Duration + await page.fill(pageLocators.DAOCreation.ExecutionDays, TezosTestData.DAOCreation.ExecutionDays); + + //Pass The Proposal Execution Hours Duration + await page.fill(pageLocators.DAOCreation.ExecutionHours, TezosTestData.DAOCreation.ExecutionHours); + + //Pass The Proposal Execution Minutes Duration + await page.fill(pageLocators.DAOCreation.ExecutionMinutes, TezosTestData.DAOCreation.ExecutionMinutes); + + //Pass The Proposal Expiry Threshold Days Duration + await page.fill(pageLocators.DAOCreation.ThresholdExpiryDays, TezosTestData.DAOCreation.ThresholdExpiryDays); + + //Pass The Proposal Expiry Threshold Hours Duration + await page.fill(pageLocators.DAOCreation.ThresholdExpiryHours, TezosTestData.DAOCreation.ThresholdExpiryHours); + + //Pass The Proposal Expiry Threshold Minutes Duration + await page.fill(pageLocators.DAOCreation.ThresholdExpiryMinutes, TezosTestData.DAOCreation.ThresholdExpiryMinutes); + + //Fill Required Stake + await page.fill(pageLocators.DAOCreation.RequireStake, TezosTestData.DAOCreation.RequiredStake); + + //Locate The Slider + const slider = page.locator(pageLocators.DAOCreation.Slider); + + // Get Target position. + const targetPosition = { x: 50, y: 0 }; + + // Ensure the slider is in view + await slider.scrollIntoViewIfNeeded(); + + // Get the bounding box of the slider for dragging + const sliderBox = await slider.boundingBox(); + + // Calculate the target position based on the slider's bounding box + const targetX = sliderBox.x + targetPosition.x; + const targetY = sliderBox.y + targetPosition.y; + + // Create a mouse action context and perform the drag and drop + await page.mouse.move(sliderBox.x, sliderBox.y); + await page.mouse.down(); + + // You can adjust the number of steps for smoother animation + // await page.mouse.move(targetX, targetY, { steps: 50 }); + + // await page.mouse.up(); + + //Pass Min Transfer Amount + await page.fill(pageLocators.DAOCreation.MinAmount, TezosTestData.DAOCreation.MinAmount); + + //Pass Max Transfer Amount + await page.fill(pageLocators.DAOCreation.MaxAmount, TezosTestData.DAOCreation.MaxAmount); + + //Click On Continue + await page.getByText(pageLocators.DAOCreation.ContinueButton).click(); + + //Pass The Initial Quorum Threshold + await page.fill(pageLocators.DAOCreation.QuorumThreshold, TezosTestData.DAOCreation.QuorumThreshold); + + //Pass The Initial Quorum Change + await page.fill(pageLocators.DAOCreation.QuorumChange, TezosTestData.DAOCreation.QuorumChange); + + //Pass The Min. Quorum Threshold + await page.fill(pageLocators.DAOCreation.MinQuorumAmount, TezosTestData.DAOCreation.MinQuorumAmount); + + //Pass The Max. Quorum Change + await page.fill(pageLocators.DAOCreation.QuorumMaxChange, TezosTestData.DAOCreation.QuorumChange); + + //Pass The Max. Quorum Threshold + await page.fill(pageLocators.DAOCreation.MaxQuorumAmount, TezosTestData.DAOCreation.MaxQuorumAmount); + + //Wait for the Page Load + await page.waitForTimeout(1000); + + //Click On Continue + await page.getByText(pageLocators.DAOCreation.ContinueButton).click(); + + //Wait For The Page Load + await page.waitForTimeout(1000); + + //Click On Continue + await page.getByText(pageLocators.DAOCreation.ContinueButton).click(); + + //Click On Self Deployed + await page.getByText(pageLocators.DAOCreation.SelfDeployed).click(); + + //Click On Launch + await page.getByText(pageLocators.DAOCreation.DeployDAO).click(); + + //Wait for Deploy the DAO + await page.waitForTimeout(60000); + + //Verify that text visible on the webpage + const content = await page.getByText(pageLocators.DAOCreation.DAOText); + await expect(content).toBeVisible; + + console.log("The DAO is successfully created and the user is redirected to a confirmation page"); + +}) \ No newline at end of file diff --git a/tests/TC02/TC02-02_DAOValues.spec.js b/tests/TC02/TC02-02_DAOValues.spec.js new file mode 100644 index 0000000..0c56cee --- /dev/null +++ b/tests/TC02/TC02-02_DAOValues.spec.js @@ -0,0 +1,51 @@ +const { test, expect } = require('@playwright/test'); +const { changeNetwork } = require("../CommonFile/Action"); +const { pageLocators } = require("../CommonFile/Locator"); +const { TezosTestData } = require("../CommonFile/TestData"); + +test('Test Case 02-02: Create DAO with various input values', async ({ page }) => { + + //To extend the time of test execution + test.setTimeout(120000); + + //Open URL and Selecting the Ghost-net + await changeNetwork(page); + + //Click on Create DAO + await page.getByText(pageLocators.DAOCreation.CreateDAO).click(); + + //Selecting Yes, I Have one + await page.getByText(pageLocators.DAOCreation.GovernanceToken).click(); + + //Click on FullDAO + await page.getByText(pageLocators.DAOCreation.FullDAO).click(); + + //Click On Continue + await page.getByText(pageLocators.DAOCreation.ContinueButton).click(); + + //Fill DAO Name + await page.fill(pageLocators.DAOCreation.DAOName, TezosTestData.DAOCreation.DAOName); + + //Fill Token Address + await page.fill(pageLocators.DAOCreation.TokenAddress, TezosTestData.DAOCreation.TokenAddress); + + //Fill Token ID + await page.fill(pageLocators.DAOCreation.TokenID, TezosTestData.DAOCreation.TokenID); + + //Fill The Wallet Address + await page.fill(pageLocators.DAOCreation.GuardianAddress, TezosTestData.DAOCreation.GuardianAddress); + + //Fill The Description + await page.fill(pageLocators.DAOCreation.Description, TezosTestData.DAOCreation.TC02_02DAODescription); + + //Click on Continue + await page.getByText(pageLocators.DAOCreation.ContinueButton).click(); + + //Get error message + const errorMessage = page.getByText(pageLocators.DAOCreation.ErrorText); + await expect(errorMessage).toBeVisible(); + + console.log(errorMessage) //Show The Result + console.log("The system handles the input appropriately, either creating the DAO or displaying an error message."); + +}) \ No newline at end of file diff --git a/tests/TC03/TC03-04_DAOConfiguration.spec.js b/tests/TC03/TC03-04_DAOConfiguration.spec.js new file mode 100644 index 0000000..dfb5839 --- /dev/null +++ b/tests/TC03/TC03-04_DAOConfiguration.spec.js @@ -0,0 +1,53 @@ +const { test, expect } = require("@playwright/test"); +const { PreProposal } = require("../CommonFile/PreProposal"); +const { pageLocators } = require("../CommonFile/Locator"); +const { TezosTestData } = require("../CommonFile/TestData"); + +test('Test case 05-04: DAO Configuration', async ({ page }) => { + + // Selecting DAO for proposal creation + await PreProposal(page); + + try { + + //To Extend the time of test Execution + test.setTimeout(120000); + + //Check if cycle status is CREATING + const cyclestatus = await page.getByText(pageLocators.ProposalCreation.Cycle) + + await expect(cyclestatus).toBeVisible() + + //Click On New Proposal + await page.getByText(pageLocators.ProposalCreation.NewProposal).click() + + //Click on DAO Configuration + await page.getByText(pageLocators.DAOConfiguration.DAOConfiguration).click(); + + // Pass The Proposal Fee + await page.fill(pageLocators.DAOConfiguration.ProposalFee, TezosTestData.DAOConfiguration.ProposalFee) + + //Pass The Returned Token Percentage + await page.fill(pageLocators.DAOConfiguration.ReturnedTokenPercentage, TezosTestData.DAOConfiguration.ReturnedTokenPercentage); + + //Wait For Type The Letters + await page.waitForTimeout(1000); + + //Click on the Submit button + await page.getByText(pageLocators.DAOConfiguration.SubmitButton).click(); + + //Wait for DAO Configuration + await page.waitForTimeout(10000); + + const validateText = await page.getByText('proposal transaction'); + await expect(validateText).toBeVisible(); + + console.log(" The proposal is successfully created.") + + } + catch (error) { + // console.log("Now Voting Cycle is Running"); + console.log(error); + } + +}) \ No newline at end of file diff --git a/tests/TC03/TC03-05_ChangeGuardian.spec.js b/tests/TC03/TC03-05_ChangeGuardian.spec.js new file mode 100644 index 0000000..4d2c972 --- /dev/null +++ b/tests/TC03/TC03-05_ChangeGuardian.spec.js @@ -0,0 +1,43 @@ +const { test, expect } = require("@playwright/test"); +const { PreProposal } = require("../CommonFile/PreProposal"); +const { pageLocators } = require("../CommonFile/Locator"); +const { TezosTestData } = require("../CommonFile/TestData"); + +test('Test case 05-05: Change Guardian', async ({ page }) => { + + // Selecting DAO for proposal creation + await PreProposal(page); + + try { + + //To Extend the time of test Execution + test.setTimeout(120000); + + //Check if cycle status is CREATING + const cyclestatus = await page.getByText(pageLocators.ProposalCreation.Cycle) + + await expect(cyclestatus).toBeVisible() + + //Click On New Proposal + await page.getByText(pageLocators.ProposalCreation.NewProposal).click() + + //Click on Change Guardian + await page.getByText(pageLocators.ChangeGuardian.ChangeGuardian).click(); + + //Pass The Wallet Address + await page.type(pageLocators.ChangeGuardian.WalletAddress, TezosTestData.ChangeGuardian.WalletAddress); + + //Click on Submit button + await page.getByText(pageLocators.ChangeGuardian.SubmitButton).click(); + + //Wait for TimeOut Submit the proposal + await page.waitForTimeout(5000); + + console.log(" The proposal is successfully created.") + + } + catch (error) { + console.log("Now Voting Cycle is running"); + } + +}) \ No newline at end of file diff --git a/tests/TC03/TC03-06_ChangeDelegate.spec.js b/tests/TC03/TC03-06_ChangeDelegate.spec.js new file mode 100644 index 0000000..59c8e23 --- /dev/null +++ b/tests/TC03/TC03-06_ChangeDelegate.spec.js @@ -0,0 +1,46 @@ +const { test, expect } = require ("@playwright/test"); +const { pageLocators } = require ("../CommonFile/Locator"); +const { TezosTestData } = require("../CommonFile/TestData"); +const { PreProposal } = require("../CommonFile/PreProposal"); + +test('Test case 05-06: Change Delegate', async ({ page }) => { + + // Selecting DAO for proposal creation + await PreProposal(page); + + try { + + //To Extend the time of test Execution + test.setTimeout(120000); + + //Check if cycle status is CREATING + const cyclestatus = await page.getByText(pageLocators.ProposalCreation.Cycle) + + await expect(cyclestatus).toBeVisible() + + //Click On New Proposal + await page.getByText(pageLocators.ProposalCreation.NewProposal).click() + + //Click on Change Delegate + await page.getByText(pageLocators.ChangeDelegate.ChangeDelegate).click(); + + //New Delegate Address + await page.type(pageLocators.ChangeDelegate.NewDelegateAddress, TezosTestData.ChangeDelegate.NewDelegateAddress); + + //Click on Submit button + await page.getByText(pageLocators.ChangeDelegate.SubmitButton).click(); + + //Wait For Timeout + await page.waitForTimeout(30000); + + await expect(await page.getByText('creating...')).toBeVisible(); + + + console.log(" The proposal is successfully created.") + + } + catch (error) { + console.log("Now Voting Cycle is running"); + } + +}) \ No newline at end of file diff --git a/tests/TC03/TC03-07_TransferTokens.spec.js b/tests/TC03/TC03-07_TransferTokens.spec.js new file mode 100644 index 0000000..708c5f3 --- /dev/null +++ b/tests/TC03/TC03-07_TransferTokens.spec.js @@ -0,0 +1,70 @@ +const { test, expect } = require("@playwright/test"); +const { PreProposal } = require("../CommonFile/PreProposal"); +const { pageLocators } = require("../CommonFile/Locator"); +const { TezosTestData } = require("../CommonFile/TestData"); + +test('Test case 05-07: Transfer Tokens', async ({ page }) => { + + // Selecting DAO for proposal creation + await PreProposal(page); + + try { + + //To Extend the time of test Execution + test.setTimeout(120000); + + //Check if cycle status is CREATING + const cyclestatus = await page.getByText(pageLocators.ProposalCreation.Cycle) + + await expect(cyclestatus).toBeVisible(); + + //Click on Treasury + await page.getByText(pageLocators.TransferToken.Treasury).click(); + + //Click on New Transfer + await page.getByText(pageLocators.TransferToken.NewTransfer).click(); + + //Enter Recipient Address + await page.type(pageLocators.TransferToken.Recipient, TezosTestData.TransferToken.RecipientAddress); + + //Click on Asset Button + await page.locator(pageLocators.TransferToken.Asset).click(); + + //Wait For Locate The Token + await page.waitForTimeout(2000); + + await page.getByRole('option', { name: pageLocators.TransferToken.TST }).click(); + + //Click on DownArrow Button + // await page.keyboard.press('ArrowDown'); + // await page.keyboard.press('Enter'); + + //Pass The Amount Wants to Transfer + await page.locator(pageLocators.TransferToken.Amount).click(); + await page.keyboard.press('Backspace'); + await page.keyboard.type(TezosTestData.TransferToken.Amount); + + //Pass The Agora Post ID + await page.locator(pageLocators.TransferToken.AgoraPostID).click(); + await page.keyboard.press('Backspace'); + await page.keyboard.type(TezosTestData.TransferToken.AgoraPostID); + + await page.waitForTimeout(5000); + + //Click On Submit Button + await page.getByText(pageLocators.TransferToken.SubmitButton).click(); + + await page.waitForTimeout(30000); + + //Verify POPUP text is visible + const validateText = await page.getByText(pageLocators.TransferToken.verifyText); + await expect(validateText).toBeVisible(); + + 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("Error: ", error); + } + +}) \ No newline at end of file diff --git a/tests/TC03/TC03-08_TransferNFT.spec.js b/tests/TC03/TC03-08_TransferNFT.spec.js new file mode 100644 index 0000000..01a9fe1 --- /dev/null +++ b/tests/TC03/TC03-08_TransferNFT.spec.js @@ -0,0 +1,57 @@ +const { test, expect } = require("@playwright/test"); +const { PreProposal } = require("../CommonFile/PreProposal"); +const { pageLocators } = require("../CommonFile/Locator"); +const { TezosTestData } = require("../CommonFile/TestData"); + +test('Test case 05-08: Transfer NFT ', async ({ page }) => { + + // Selecting DAO for proposal creation + await PreProposal(page); + + try { + + //To Extend the time of test Execution + test.setTimeout(120000); + + //Check if cycle status is CREATING + const cyclestatus = await page.getByText(pageLocators.ProposalCreation.Cycle) + + await expect(cyclestatus).toBeVisible() + + //Click on Treasury + await page.getByText(pageLocators.TransferToken.Treasury).click(); + + //Click on NFTs + await page.getByText(pageLocators.TransferNFT.NFTs).click(); + + //Click on New Transfer + await page.getByText(pageLocators.TransferToken.NewTransfer).click(); + + //Enter Recipient Address + await page.type(pageLocators.TransferToken.Recipient, TezosTestData.TransferToken.RecipientAddress); + + + //Enter The Agora Post ID + await page.locator(pageLocators.TransferToken.AgoraPostID).click(); + await page.keyboard.press('Backspace'); + await page.keyboard.type(TezosTestData.TransferToken.AgoraPostID); + + await page.waitForTimeout(3000); + + //Click On Submit Button + await page.getByText(pageLocators.TransferToken.SubmitButton).click(); + + await page.waitForTimeout(30000); + + //Verify POPUP text is visible + const validateText = await page.getByText(pageLocators.TransferToken.verifyText); + await expect(validateText).toBeVisible(); + + 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("Error: ", error); + } + +}) \ No newline at end of file diff --git a/tests/TC03/TC03-09_EditRegistry.spec.js b/tests/TC03/TC03-09_EditRegistry.spec.js new file mode 100644 index 0000000..b2c2800 --- /dev/null +++ b/tests/TC03/TC03-09_EditRegistry.spec.js @@ -0,0 +1,59 @@ +const { test, expect } = require("@playwright/test"); +const { pageLocators } = require("../CommonFile/Locator"); +const { PreProposal } = require("../CommonFile/PreProposal"); +const { TezosTestData } = require("../CommonFile/TestData"); + +test('Test case 05-09: Edit Registry', async ({ page }) => { + + // Selecting DAO for proposal creation + await PreProposal(page); + + try { + + //To Extend the time of test Execution + test.setTimeout(120000); + + //Check if cycle status is CREATING + const cyclestatus = await page.getByText(pageLocators.ProposalCreation.Cycle) + + await expect(cyclestatus).toBeVisible(); + + //Click on Registry + await page.getByText(pageLocators.EditRegistry.Registry).click(); + + // Click On the New Registry item + await page.getByText(pageLocators.EditRegistry.NewItem).click(); + + // Enter The Key For Registry + await page.type(pageLocators.EditRegistry.Key,TezosTestData.EditRegistry.Key); + + //Enter The Value + await page.type(pageLocators.EditRegistry.Value, TezosTestData.EditRegistry.Value); + + //Pass The Agora Post ID + await page.locator(pageLocators.TransferToken.AgoraPostID).click(); + await page.keyboard.press('Backspace'); + await page.keyboard.type(TezosTestData.TransferToken.AgoraPostID); + + await page.waitForTimeout(5000); + + //Click On Submit Button + await page.getByText(pageLocators.TransferToken.SubmitButton).click(); + + await page.waitForTimeout(30000); + + //Verify POPUP text is visible + const validateText = await page.getByText(pageLocators.EditRegistry.verifyText); + await expect(validateText).toBeVisible(); + + 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("Error: ", error); + } + + + +}) + diff --git a/tests/TC04/TC04-01_OffChainPoll.spec.js b/tests/TC04/TC04-01_OffChainPoll.spec.js new file mode 100644 index 0000000..c464205 --- /dev/null +++ b/tests/TC04/TC04-01_OffChainPoll.spec.js @@ -0,0 +1,65 @@ +const { test, expect } = require('@playwright/test'); +const { PreProposal } = require('../CommonFile/PreProposal'); +const { pageLocators } = require('../CommonFile/Locator'); +const { TezosTestData } = require('../CommonFile/TestData'); + +test('Test case 04-01: Off Chain Poll Proposal Creation', async ({ page }) => { + + // Selecting DAO for proposal creation + await PreProposal(page); + + try { + //To extend the time of test execution + test.setTimeout(120000); + + //Click on new Proposal + await page.getByText(pageLocators.OffChainPoll.NewProposal).click(); + + //Click on Off Chain Poll + await page.getByText(pageLocators.OffChainPoll.OffChainPoll).click(); + + //Pass the Proposal Title + await page.type(pageLocators.OffChainPoll.ProposalTitle, TezosTestData.OffChainPoll.ProposalTitle); + + //Pass the Short Description + await page.type(pageLocators.OffChainPoll.Description, TezosTestData.OffChainPoll.Description); + + //Pass the External Link + await page.type(pageLocators.OffChainPoll.ExternalLink, TezosTestData.OffChainPoll.ExternalLink); + + // Click on Multiple Choice + await page.click(pageLocators.OffChainPoll.multipleChoice); + + //Pass the Choice 1 Data + await page.type(pageLocators.OffChainPoll.Choice1, TezosTestData.OffChainPoll.Choice1); + + //Click on Add Choice + await page.click(pageLocators.OffChainPoll.AddChoice); + + //Pass The Choice 2 Data + await page.type(pageLocators.OffChainPoll.Choice2, TezosTestData.OffChainPoll.Choice2); + + //Pass The Date + await page.type(pageLocators.OffChainPoll.DD, TezosTestData.OffChainPoll.DD); + + //Pass The Hours + await page.type(pageLocators.OffChainPoll.HH, TezosTestData.OffChainPoll.HH); + + //Pass The Minute + await page.type(pageLocators.OffChainPoll.MM, TezosTestData.OffChainPoll.MM); + + //Click on the Create Proposal Button + await page.getByText(pageLocators.OffChainPoll.CreateProposalButton).click(); + + //Wait for Text Visible on Webpage + const validateText = await page.getByText(pageLocators.OffChainPoll.CreateText) + await expect (validateText).toBeVisible(); + + console.log("The poll is successfully created.") + + } catch (error) { + console.error('Error:', error); + } + + +}) \ No newline at end of file diff --git a/tests/TC04/TC04-02_VoteonOffChainPoll.spec.js b/tests/TC04/TC04-02_VoteonOffChainPoll.spec.js new file mode 100644 index 0000000..23aebef --- /dev/null +++ b/tests/TC04/TC04-02_VoteonOffChainPoll.spec.js @@ -0,0 +1,29 @@ +const { test, expect } = require("@playwright/test"); +const { PreProposal } = require("../CommonFile/PreProposal"); +const { pageLocators } = require("../CommonFile/Locator"); + +test('Test case 04-02: Vote On Off Chain Proposal ', async ({ page }) => { + + //To extend the time of test execution + test.setTimeout(120000); + + // Selecting DAO for proposal creation + await PreProposal(page); + + //Click on the Proposal Name + await page.getByRole('heading', { name: pageLocators.VoteOnOffChainPoll.ProposalName }).first().click(); + + //Click On Option 1 + await page.getByText(pageLocators.VoteOnOffChainPoll.Option1).first().click(); + + //Submit Your Votes + await page.getByText(pageLocators.VoteOnOffChainPoll.CastYourVote).click(); + + await page.waitForTimeout(3000); + + const validateText = await page.getByText(pageLocators.VoteOnOffChainPoll.VoteVerify); + await expect(validateText).toBeVisible; + + console.log("The vote is successfully casted."); + +}) \ No newline at end of file diff --git a/tests/TC04/TC04-03_CorrectVoteCountOnOffChainPoll.spec.js b/tests/TC04/TC04-03_CorrectVoteCountOnOffChainPoll.spec.js new file mode 100644 index 0000000..d0e45a9 --- /dev/null +++ b/tests/TC04/TC04-03_CorrectVoteCountOnOffChainPoll.spec.js @@ -0,0 +1,33 @@ +const { test, expect } = require("@playwright/test"); +const { PreProposal } = require("../CommonFile/PreProposal"); +const { pageLocators } = require("../CommonFile/Locator"); + +test('Test case 04-03: Correct vote Count on Off Chain Poll ', async ({ page }) => { + + //To extend the time of test execution + test.setTimeout(120000); + + // Selecting DAO for proposal creation + await PreProposal(page); + + //Click on the Proposal Name + await page.getByRole('heading', { name: pageLocators.VoteOnOffChainPoll.ProposalName }).first().click(); + + await page.waitForTimeout(2000); + + // get The element + const content = await page.$(pageLocators.CorrectVoteCount.VoteCount); + + //wait for get the votes + await page.waitForTimeout(2000); + + //get the text From this element + const textContent = await content.innerText(); + await expect(parseInt(textContent)).toBeGreaterThanOrEqual(1) + + // Console The test Present on the Webpage + console.log('Votes:', textContent); + + console.log("The vote count matches the number of votes submitted for the poll.") + +}) \ No newline at end of file diff --git a/tests/TC05-01_ChangeDelegate.spec.js b/tests/TC05-01_ChangeDelegate.spec.js deleted file mode 100644 index b97b384..0000000 --- a/tests/TC05-01_ChangeDelegate.spec.js +++ /dev/null @@ -1,42 +0,0 @@ -const { test, expect } = require("@playwright/test"); -const { PreProposal } = require("./CommonFile/PreAction"); -const { pageLocators } = require("./CommonFile/Locator"); -const { TezosTestData } = require("./CommonFile/TestData"); - -test('Test case 05-01: Change Delegate', async ({ page }) => { - - await PreProposal(page); //PreConditions Open URL and Open Mask DAO For Proposal - - try { - test.setTimeout(600000); //To Extend the time of test Execution - - await page.click(pageLocators.OffChainPoll.cycle); // Click on Running Cycle Status - - await page.click(pageLocators.OffChainPoll.NewProposal); //Click on new Proposal - - await page.click(pageLocators.ChangeDelegate.ChangeDelegate); //Click on Change Delegate - - await page.type(pageLocators.ChangeDelegate.NewDelegateAddress, TezosTestData.ChangeDelegate.NewDelegateAddress); //New Delegate Address - - await page.click(pageLocators.ChangeDelegate.SubmitButton); //Click on Submit button - - await page.waitForTimeout(30000); //Wait For Timeout - - const isTextVisible = content.includes(pageLocators.ChangeDelegate.PopUp, { visible: true }); //Verify that text visible on the webpage - - if (!isTextVisible) { - console.error("Expected text is not visible. Test case failed."); - } - - await page.click(pageLocators.OffChainPoll.Proposal) //Click on the Proposal - - console.log("Uploading Report"); - - 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/TC05-02_ChangeGuardian.spec.js b/tests/TC05-02_ChangeGuardian.spec.js deleted file mode 100644 index 94d89ad..0000000 --- a/tests/TC05-02_ChangeGuardian.spec.js +++ /dev/null @@ -1,37 +0,0 @@ -const { test, expect } = require("@playwright/test"); -const { PreProposal } = require("./CommonFile/PreAction"); -const { pageLocators } = require("./CommonFile/Locator"); -const { TezosTestData } = require("./CommonFile/TestData"); - -test('Test case 05-02: Change Guardian', async ({ page }) => { - - await PreProposal(page); //PreConditions Open URL and Open Mask DAO For Proposal - - try { - - test.setTimeout(600000); //To Extend the time of test Execution - - await page.click(pageLocators.OffChainPoll.cycle); // Click on Running Cycle Status - - await page.click(pageLocators.OffChainPoll.NewProposal); //Click on new Proposal - - await page.click(pageLocators.ChangeGuardian.ChangeGuardian); //Click on Change Guardian - - await page.type(pageLocators.ChangeGuardian.WalletAddress, TezosTestData.ChangeGuardian.WalletAddress); //Pass The Wallet Address - - await page.click(pageLocators.ChangeGuardian.SubmitButton); //Click on Submit button - - await page.waitForTimeout(30000); //Wait for TimeOut Submit the proposal - - const isTextVisible = content.includes(pageLocators.TokenCreator.DeployText, { visible: true }); //Verify that text visible on the webpage - - console.log("Uploading Report"); - - 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/TC05-03_TransferTokens.spec.js b/tests/TC05-03_TransferTokens.spec.js deleted file mode 100644 index 500bec6..0000000 --- a/tests/TC05-03_TransferTokens.spec.js +++ /dev/null @@ -1,56 +0,0 @@ -const { test, expect } = require("@playwright/test"); -const { PreProposal } = require("./CommonFile/PreAction"); -const { pageLocators } = require("./CommonFile/Locator"); -const { TezosTestData } = require("./CommonFile/TestData"); - -test('Test case 05-03: Transfer Tokens', async ({ page }) => { - - await PreProposal(page); //PreConditions Open URL and Open Mask DAO For Proposal - - try { - - test.setTimeout(600000); //To Extend the time of test Execution - - await page.click(pageLocators.OffChainPoll.cycle); // Click on Running Cycle Status - - await page.click(pageLocators.TransferToken.Treasury); //Click on Treasury - - await page.click(pageLocators.TransferToken.NewTransfer); //Click on Transfer - - await page.type(pageLocators.TransferToken.Recipient, TezosTestData.TransferToken.RecipientAddress); //Pass The Recipient Address - - await page.type(pageLocators.TransferToken.Asset, TezosTestData.TransferToken.Asset); //Click on Asset Button - - await page.waitForTimeout(2000) //Wait For Locate The Token - - await page.keyboard.press('ArrowDown'); //Click on DownArrow Button - - await page.keyboard.press('Enter'); //Click on Enter Button - - await page.type(pageLocators.TransferToken.Amount, TezosTestData.TransferToken.Amount); //Pass The Amount Wants to Transfer - - await page.type(pageLocators.TransferToken.AgoraPostID, TezosTestData.TransferToken.AgoraPostID); //Pass The Agora Post ID - - await page.click(pageLocators.TransferToken.SubmitButton); //Click On Submit Button - - await page.waitForTimeout(30000); //Wait for Transfer Tokens - - const isTextVisible = content.includes(pageLocators.TransferToken.TransactionText, { visible: true }); //Verify that text visible on the webpage - - console.log(isTextVisible); // console The Pass And Fail Result - - console.log("Uploading Report"); - - 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/TC05-04_ChangeConfiguration.spec.js b/tests/TC05-04_ChangeConfiguration.spec.js deleted file mode 100644 index a6531a7..0000000 --- a/tests/TC05-04_ChangeConfiguration.spec.js +++ /dev/null @@ -1,40 +0,0 @@ -const { test, expect } = require("@playwright/test"); -const { PreProposal } = require("./CommonFile/PreAction"); -const { pageLocators } = require("./CommonFile/Locator"); - -test('Test case 05-04: Change Configuration', async ({ page }) => { - - await PreProposal(page); //PreConditions Open URL and Open Mask DAO For Proposal - - try { - - test.setTimeout(600000) //To Extend The Time of test Execution - - await page.click(pageLocators.OffChainPoll.cycle); // Click on Running Cycle Status - - await page.click(pageLocators.OffChainPoll.NewProposal); //Click on new Proposal - - await page.click(pageLocators.DAOConfiguration.DAOConfiguration); //Click on DAO Configuration - - await page.locator(pageLocators.DAOConfiguration.ProposalFee); // Pass The Proposal Fee - await page.keyboard.type('1'); - - await page.locator(pageLocators.DAOConfiguration.ReturnedTokenPercentage); //Pass The Returned Token Percentage - await page.keyboard.type('1'); - - await page.waitForTimeout(1000); //Wait For Type The Letters - - await page.click(pageLocators.DAOConfiguration.SubmitButton); //Click on the Submit button - - await page.waitForTimeout(5000); //Wait for DAO Configuration - - console.log("Uploading Report"); - - 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/TC05-05_TransferNFT.spec.js b/tests/TC05-05_TransferNFT.spec.js deleted file mode 100644 index c43cbae..0000000 --- a/tests/TC05-05_TransferNFT.spec.js +++ /dev/null @@ -1,30 +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 05-05: Transfer NFT ', async ({ page }) => { - - await PreProposal(page); //PreConditions Open URL and Open Mask DAO For Proposal - - try { - - test.setTimeout(600000); //To Extend the time of test Execution - - 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("Uploading Report"); - - 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/TC05-06_EditRegistry.spec.js b/tests/TC05-06_EditRegistry.spec.js deleted file mode 100644 index 379eb1f..0000000 --- a/tests/TC05-06_EditRegistry.spec.js +++ /dev/null @@ -1,38 +0,0 @@ -const { test, expect } = require("@playwright/test"); -const { PreProposal } = require("./CommonFile/PreAction"); -const { pageLocators } = require("./CommonFile/Locator"); -const { TezosTestData } = require("./CommonFile/TestData"); - -test('Test case 05-06: Edit Registry', async ({ page }) => { - - await PreProposal(page); //PreConditions Open URL and Open Mask DAO For Proposal - - try { - - test.setTimeout(600000); //To Extend the time of test Execution - - await page.click(pageLocators.OffChainPoll.cycle); // Click on Running Cycle Status - - await page.click(pageLocators.EditRegistry.Registry); //Click on the Registry on Tab - - await page.click(pageLocators.EditRegistry.NewItem); // Click On the New Registry item - - await page.type(pageLocators.EditRegistry.Key,TezosTestData.EditRegistry.Key); // Pass The Key For Registry - - await page.type(pageLocators.EditRegistry.Value, TezosTestData.EditRegistry.Value); //Pass The Value - - await page.click(pageLocators.EditRegistry.Submit); //Click on the submit button - - await page.waitForTimeout(30000); //Wait for Timeout the Script - - 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"); - } - - - -}) - diff --git a/tests/TC05-07_AddLambda.spec.js b/tests/TC05-07_AddLambda.spec.js deleted file mode 100644 index 189090c..0000000 --- a/tests/TC05-07_AddLambda.spec.js +++ /dev/null @@ -1,38 +0,0 @@ -const { test, expect } = require("@playwright/test"); -const { PreProposal } = require("./CommonFile/PreAction"); -const { pageLocators } = require("./CommonFile/Locator"); -const { TezosTestData } = require("./CommonFile/TestData"); - -test('Test case 05-07: Add Lambda ', async ({ page }) => { - - await PreProposal(page); //PreConditions Open URL and Open Mask DAO For Proposal - - try { - - test.setTimeout(600000); //To Extend the time of test Execution - - await page.click(pageLocators.OffChainPoll.cycle); // Click on Running Cycle Status - - await page.click(pageLocators.OffChainPoll.NewProposal); //Click On New Proposal - - await page.click(pageLocators.AddLambda.AddLambda); // Click on Add Lambda - - await page.type(pageLocators.AddLambda.TestBox, TezosTestData.AddLambda.MichelsonCode); //Pass The Michelson Code - - await page.click(pageLocators.AddLambda.SubmitButton); //Click on Submit Button - - await page.waitForTimeout(30000); //Wait for Lambda Implementation - - console.log("Uploading Report"); - - 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/TC05-08_RemoveLambda.spec.js b/tests/TC05-08_RemoveLambda.spec.js deleted file mode 100644 index 5d5cfd6..0000000 --- a/tests/TC05-08_RemoveLambda.spec.js +++ /dev/null @@ -1,39 +0,0 @@ -const { test, expect } = require("@playwright/test"); -const { PreProposal } = require("./CommonFile/PreAction"); -const { pageLocators } = require("./CommonFile/Locator"); -const { TezosTestData } = require("./CommonFile/TestData"); - -test('Test case 05-08: Remove Lambda ', async ({ page }) => { - - await PreProposal(page); //PreConditions Open URL and Open Mask DAO For Proposal - - try { - - test.setTimeout(600000); //To Extend the time of test Execution - - await page.click(pageLocators.OffChainPoll.cycle); // Click on Running Cycle Status - - await page.click(pageLocators.OffChainPoll.NewProposal); //Click On New Proposal - - await page.click(pageLocators.RemoveLambda.RemoveLambda); //Click on Remove Lambda - - await page.type(pageLocators.RemoveLambda.SearchBox, TezosTestData.RemoveLambda.SearchText); //Pass The Search Text - - await page.keyboard.press('ArrowDown'); //Click on DownArrow Button - - await page.keyboard.press('Enter'); //Click on Enter Button - - await page.click(pageLocators.RemoveLambda.SubmitButton); //Click on Submit Button - - await page.waitForTimeout(30000); //Wait For Remove the Lambda - - 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/TC05-09_ExecuteLambda.spec.js b/tests/TC05-09_ExecuteLambda.spec.js deleted file mode 100644 index 5e7f87b..0000000 --- a/tests/TC05-09_ExecuteLambda.spec.js +++ /dev/null @@ -1,42 +0,0 @@ -const { test, expect } = require("@playwright/test"); -const { PreProposal } = require("./CommonFile/PreAction"); -const { pageLocators } = require("./CommonFile/Locator"); -const { TezosTestData } = require("./CommonFile/TestData"); - -test('Test case 05-09: Execute Lambda ', async ({ page }) => { - - await PreProposal(page); //PreConditions Open URL and Open Mask DAO For Proposal - - try { - test.setTimeout(600000); //To Extend the time of test Execution - - await page.click(pageLocators.OffChainPoll.cycle); // Click on Running Cycle Status - - await page.click(pageLocators.OffChainPoll.NewProposal); //Click On New Proposal - - await page.click(pageLocators.ExecuteLambda.ExecuteLambda); //Click on Execute Lambda - - await page.type(pageLocators.ExecuteLambda.SearchBox, TezosTestData.ExecuteLambda.SearchText); //Pass the Search Text - - await page.waitForTimeout(1000); //Wait For Pass The Data - - await page.keyboard.press('ArrowDown'); //Click on DownArrow Button - - await page.keyboard.press('Enter'); //Click on Enter Button - - await page.getByPlaceholder(pageLocators.ExecuteLambda.ExecuteLambda).type(TezosTestData.ExecuteLambda.LambdaArgumentsCode); //Pass The Lambda Arguments Code - - await page.getByPlaceholder(pageLocators.ExecuteLambda.LambdaParams).type(TezosTestData.ExecuteLambda.LambdaParams); //Pass The Lambda Params Code - - await page.waitForTimeout(2000); //Wait For Validate - - await page.click(pageLocators.ExecuteLambda.SubmitButton); //Click On the Submit Button - - await page.waitForTimeout(5000); //Wait For Pass The test Data - - } - catch (error) { - console.log("Now Voting cycle is running"); - } - -}) \ No newline at end of file diff --git a/tests/TC05/TC05-01_VoteOnProposal.spec.js b/tests/TC05/TC05-01_VoteOnProposal.spec.js new file mode 100644 index 0000000..0dd2d2c --- /dev/null +++ b/tests/TC05/TC05-01_VoteOnProposal.spec.js @@ -0,0 +1,54 @@ +const { test, expect } = require("@playwright/test"); +const { PreProposal } = require("../CommonFile/PreProposal"); +const { pageLocators } = require("../CommonFile/Locator"); +const { TezosTestData } = require("../CommonFile/TestData"); + +test('Test case 05-01: Vote On Proposal ', async ({ page }) => { + + // Selecting DAO for proposal creation + await PreProposal(page); + + try { + + //To Extend the time of test Execution + test.setTimeout(160000); + + //Check if cycle status is CREATING + const cyclestatus = await page.getByText(pageLocators.ProposalCreation.Cycle) + + await expect(cyclestatus).not.toBeVisible(); + + //Click on the Active Button + await page.getByText(pageLocators.VotingOnChain.active, {exact: true}).click(); + + await page.waitForTimeout(3000); + + //Click on the Vote For Support + await page.getByText(pageLocators.VotingOnChain.VoteFor).click(); + + //Enter an amount + await page.type(pageLocators.VotingOnChain.Amount, TezosTestData.VotingOnChain.Amount); + + await page.waitForTimeout(5000) + + //Click on the Submit + await page.getByText(pageLocators.VotingOnChain.Submit).click(); + + //Wait for Submit the Proposal + await page.waitForTimeout(10000); + + //Validate that Confirmation message is shown + const validateText = await page.getByText(pageLocators.VotingOnChain.validateText); + await expect(validateText).toBeVisible(); + + console.log("Vote was casted successfully."); + + } + catch (error) { + // console.log("Now Creating Cycle is running"); + console.log(error); + } + + + +}) \ No newline at end of file diff --git a/tests/TC05/TC05-02_ProposalExecutionandDrop.spec.js b/tests/TC05/TC05-02_ProposalExecutionandDrop.spec.js new file mode 100644 index 0000000..b8198ba --- /dev/null +++ b/tests/TC05/TC05-02_ProposalExecutionandDrop.spec.js @@ -0,0 +1,52 @@ +const { test, expect } = require("@playwright/test"); +const { PreProposal } = require("../CommonFile/PreProposal"); +const { pageLocators } = require("../CommonFile/Locator"); + +test('Test case 05-02: Proposal Execution & Drop', async ({ page }) => { + + //To Extend the time of test Execution + test.setTimeout(120000); + + // Selecting DAO for proposal creation + await PreProposal(page); + + try { + + //Check if cycle status is CREATING + const cyclestatus = await page.getByText(pageLocators.ProposalCreation.Cycle) + + await expect(cyclestatus).not.toBeVisible(); + + await page.waitForTimeout(5000); + + // To check if proposal is in Passed-Executable state + const passed = await page.getByText(pageLocators.ProposalExecutionandDrop.PassedExecutable); + const isexecuteable = await expect(passed).toBeEnabled(); + console.log(isexecuteable); + + await page.waitForTimeout(5000) + // Click on the Passed - Executeable + if (isexecuteable) { + console.log("pass1") + + const executeBtn = await page.getByText(pageLocators.ProposalExecutionandDrop.Execute); + const isclickable = await expect(executeBtn).toBeEnabled(); + + //Validate That Button is clickable or not + if (isclickable) { + console.log("pass2") + //Click on Execute Button + await page.executeBtn.click(); + } + } else { + console.log("failll") + //Click on drop Expired Proposal + await page.getByText(pageLocators.ProposalExecutionandDrop.DropExpired).click(); + } + + } + catch (error) { + console.log("Error:", error); + } + +}) \ No newline at end of file diff --git a/tests/TC06/TC06-01_TokenWithdraw.spec.js b/tests/TC06/TC06-01_TokenWithdraw.spec.js new file mode 100644 index 0000000..12856aa --- /dev/null +++ b/tests/TC06/TC06-01_TokenWithdraw.spec.js @@ -0,0 +1,34 @@ +const { test, expect } = require("@playwright/test"); +const { pageLocators } = require("../CommonFile/Locator"); +const { PreProposal } = require("../CommonFile/PreProposal"); +const { TezosTestData } = require("../CommonFile/TestData"); + +test('Test case 06-01: Successful Token Withdrawal', async ({ page }) => { + + //To Extend the time of test Execution + test.setTimeout(160000); + + // Selecting DAO for proposal creation + await PreProposal(page); + + //Click on the User Tab + await page.getByText(pageLocators.TokenWithdrawal.User).click(); + + //Click on Withdraw Button + await page.getByText(pageLocators.TokenWithdrawal.Withdraw).click(); + + //Enter amount to withdraw + await page.type(pageLocators.TokenWithdrawal.Amount, TezosTestData.TokenWithdrawal.Amount); + + //Click on Submit Button + await page.getByText(pageLocators.TokenWithdrawal.Submit).click(); + + await page.waitForTimeout(30000); + + //Verify the PopUp text. + const validateText = await page.getByText(pageLocators.TokenWithdrawal.verifyText); + await expect(validateText).toBeVisible(); + + console.log("The tokens were successfully withdrawed and the remaining tokens are visible in Available Balance. ") + +}) \ No newline at end of file diff --git a/tests/TC06/TC06-02_TokenStaking.spec.js b/tests/TC06/TC06-02_TokenStaking.spec.js new file mode 100644 index 0000000..d92e7e1 --- /dev/null +++ b/tests/TC06/TC06-02_TokenStaking.spec.js @@ -0,0 +1,34 @@ +const { test, expect } = require("@playwright/test"); +const { PreProposal } = require("../CommonFile/PreProposal"); +const { pageLocators } = require("../CommonFile/Locator"); +const { TezosTestData } = require("../CommonFile/TestData"); + +test('Test case 06-02: Successful Token Staking', async ({ page }) => { + + //To Extend the time of test Execution + test.setTimeout(160000); + + // Selecting DAO for proposal creation + await PreProposal(page); + + //Click on the User Tab + await page.getByText(pageLocators.TokenDeposit.User).click(); + + //Click on the Deposit Button + await page.getByText(pageLocators.TokenDeposit.Deposit).click(); + + //Pass The Amount + await page.type(pageLocators.TokenDeposit.Amount, TezosTestData.TokenDeposit.Amount); + + //Click on the Submit Button + await page.getByText(pageLocators.TokenDeposit.Submit).click(); + + await page.waitForTimeout(30000); + + // Verify the PopUp text + const validateText = await page.getByText(pageLocators.TokenDeposit.verifyText); + await expect(validateText).toBeVisible; + + console.log(" The tokens are successfully staked and are visible in Pending Balance field."); + +}) \ No newline at end of file diff --git a/tests/TC06/TC06-03_TokenUnstaking.spec.js b/tests/TC06/TC06-03_TokenUnstaking.spec.js new file mode 100644 index 0000000..1a1d08f --- /dev/null +++ b/tests/TC06/TC06-03_TokenUnstaking.spec.js @@ -0,0 +1,42 @@ +const { test, expect } = require("@playwright/test"); +const { PreProposal } = require("../CommonFile/PreProposal"); +const { pageLocators } = require("../CommonFile/Locator"); + +test('Test case 06-03: Successful Token UnStaking', async ({ page }) => { + + try { + + //To Extend the time of test Execution + test.setTimeout(160000); + + // Selecting DAO for proposal creation + await PreProposal(page); + + await page.waitForTimeout(10000); + + // Click on Drop Expire + await page.getByText(pageLocators.TokenUnstaking.Drop).click(); + + await page.waitForTimeout(30000); + + // go to Users tab + await page.getByText(pageLocators.TokenUnstaking.User).click(); + + await page.waitForTimeout(5000); + + //Click on UnStake Votes + page.getByText(pageLocators.TokenUnstaking.Unstake).click(); + + await page.waitForTimeout(12000); + + // Verify PopUp text + const validateText2 = await page.getByText(pageLocators.TokenUnstaking.verifyText); + await expect(validateText2).toBeVisible(); + + console.log("The tokens are successfully Unstaked."); + + } + catch (error) { + console.log("Error: ", error); + } +}) \ No newline at end of file diff --git a/tests/TC06_VoteOnProposal.spec.js b/tests/TC06_VoteOnProposal.spec.js deleted file mode 100644 index c063376..0000000 --- a/tests/TC06_VoteOnProposal.spec.js +++ /dev/null @@ -1,49 +0,0 @@ -const { test, expect } = require("@playwright/test"); -const { PreProposal } = require("./CommonFile/PreAction"); -const { pageLocators } = require("./CommonFile/Locator"); -const path = require('path'); - -test('Test case 06: Vote On Proposal ', async ({ page }) => { - - await PreProposal(page); //PreConditions Open URL and Open Mask DAO For Proposal - - try { - - test.setTimeout(600000); //To Extend the time of test Execution - - 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.click(pageLocators.VoteOnProposal.Submit); //Click on the Submit - - await page.waitForTimeout(2000); //Wait for Submit the Proposal - - await page.click(pageLocators.VoteOnProposal.View); //Click on the View Button - - await page.waitForTimeout(1000); - - const elementHandle0 = await page.$(pageLocators.VoteOnProposal.Support); // Find the element - - const textContent0 = await elementHandle0.textContent(); //get the text from element - - console.log(textContent0); //Print the test - - const elementHandle1 = await page.$(pageLocators.VoteOnProposal.Oppose); // Find the element - - const textContent1 = await elementHandle1.textContent(); //get the text from element - - console.log(textContent1); //Print the test - - } - catch (error) { - console.log("Now Creating Cycle is running"); - } - - - -}) \ No newline at end of file diff --git a/tests/TC07_ProposalExecutionandDrop.spec.js b/tests/TC07_ProposalExecutionandDrop.spec.js deleted file mode 100644 index ed1c198..0000000 --- a/tests/TC07_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 07: Proposal Execution & Drop', async ({ page }) => { - - test.setTimeout(600000); //To Extend the time of test Execution - - 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 - Executeable - - 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/TC08_OffChainPoll.spec.js b/tests/TC08_OffChainPoll.spec.js deleted file mode 100644 index 7f25113..0000000 --- a/tests/TC08_OffChainPoll.spec.js +++ /dev/null @@ -1,51 +0,0 @@ -const { test, expect } = require("@playwright/test"); -const { PreProposal } = require("./CommonFile/PreAction"); -const { pageLocators } = require("./CommonFile/Locator"); -const { TezosTestData } = require("./CommonFile/TestData"); - -test('Test case 08: Off Chain Poll Proposal Creation', async ({ page }) => { - - test.setTimeout(600000); //To Extend the time of test Execution - - await PreProposal(page); //PreConditions Open URL and Open Mask DAO For Proposal - - try { - - await page.click(pageLocators.OffChainPoll.cycle); // Click on Running Cycle Status - - await page.click(pageLocators.OffChainPoll.NewProposal); //Click on new Proposal - - await page.click(pageLocators.OffChainPoll.OffChainPoll); //Click on Off Chain Poll - - await page.type(pageLocators.OffChainPoll.ProposalTitle, TezosTestData.OffChainPoll.ProposalTitle); //Pass the Proposal Title - - await page.type(pageLocators.OffChainPoll.ShortDescription, TezosTestData.OffChainPoll.ShortDescription); //Pass the Short Description - - await page.type(pageLocators.OffChainPoll.ExternalLink, TezosTestData.OffChainPoll.ExternalLink); //Pass the External Link - - await page.click(pageLocators.OffChainPoll.multipleChoice); // Click on Multiple Choice - - await page.type(pageLocators.OffChainPoll.Choice1, TezosTestData.OffChainPoll.Choice1); //Pass the Choice 1 Data - - await page.click(pageLocators.OffChainPoll.AddChoice); //Click on Add Choice - - await page.type(pageLocators.OffChainPoll.Choice2, TezosTestData.OffChainPoll.Choice2); //Pass The Choice 2 Data - - await page.type(pageLocators.OffChainPoll.DD, TezosTestData.OffChainPoll.DD); //Pass The Date - - await page.type(pageLocators.OffChainPoll.HH, TezosTestData.OffChainPoll.HH); //Pass The Hours - - await page.type(pageLocators.OffChainPoll.MM, TezosTestData.OffChainPoll.MM); //Pass The Minute - - await page.click(pageLocators.OffChainPoll.CreateProposalButton); //Click on the Create Proposal Button - - await page.waitForSelector(pageLocators.OffChainPoll.CreateText, { visible: true}); //Wait for Text Visible on Webpage - - console.log("The poll is successfully created and the user is redirected to a confirmation page with the details of the newly created poll.") - - } catch (error) { - console.error('Error:', error); - } - - -}) \ No newline at end of file diff --git a/tests/TC09_VoteonOffChainPoll.spec.js b/tests/TC09_VoteonOffChainPoll.spec.js deleted file mode 100644 index 6e49a10..0000000 --- a/tests/TC09_VoteonOffChainPoll.spec.js +++ /dev/null @@ -1,19 +0,0 @@ -const { test, expect } = require("@playwright/test"); -const { PreProposal } = require("./CommonFile/PreAction"); -const { pageLocators } = require("./CommonFile/Locator"); - -test('Test case 09: Vote On Off Chain Proposal ', async ({ page }) => { - - test.setTimeout(600000); //To Extend the time of test Execution - - await PreProposal(page); //PreConditions Open URL and Open Mask DAO For Proposal - - await page.click(pageLocators.VoteOnOffChainPoll.ProposalName); //Click on the Proposal Name - - await page.click(pageLocators.VoteOnOffChainPoll.Option1); //Click On Option 1 - - 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/TC10_CorrectVoteCountOnOffChainPoll.spec.js b/tests/TC10_CorrectVoteCountOnOffChainPoll.spec.js deleted file mode 100644 index 0069fdb..0000000 --- a/tests/TC10_CorrectVoteCountOnOffChainPoll.spec.js +++ /dev/null @@ -1,25 +0,0 @@ -const { test, expect } = require("@playwright/test"); -const { PreProposal } = require("./CommonFile/PreAction"); -const { pageLocators } = require("./CommonFile/Locator"); - -test('Test case 10: Correct vote Count on Off Chain Poll ', async ({ page }) => { - - test.setTimeout(600000); //To Extend the time of test Execution - - await PreProposal(page); //PreConditions Open URL and Open Mask DAO For Proposal - - await page.click(pageLocators.VoteOnOffChainPoll.ProposalName); - - await page.waitForSelector(pageLocators.CorrectVoteCount.VoteCount); //Wait for find the Element - - const element = await page.$(pageLocators.CorrectVoteCount.VoteCount); // 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('Votes:', textContent); // Console The test Present on the Webpage - - console.log("The vote count matches the number of votes submitted for the poll, and if multiple choice is enabled, the voting weight is evenly split between all the options that a voter picked.") - -}) \ No newline at end of file diff --git a/tests/TC11_SuccessfulTokenStaking.spec.js b/tests/TC11_SuccessfulTokenStaking.spec.js deleted file mode 100644 index 095e2f4..0000000 --- a/tests/TC11_SuccessfulTokenStaking.spec.js +++ /dev/null @@ -1,26 +0,0 @@ -const { test, expect } = require("@playwright/test"); -const { PreProposal } = require("./CommonFile/PreAction"); -const { pageLocators } = require("./CommonFile/Locator"); -const path = require('path'); - -test('Test case 11: Successful Token Staking', async ({ page }) => { - - test.setTimeout(600000); //To Extend the time of test Execution - - 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.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 - - 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/TC12_SuccessfulTokenUnStaking.spec.js b/tests/TC12_SuccessfulTokenUnStaking.spec.js deleted file mode 100644 index 3e14988..0000000 --- a/tests/TC12_SuccessfulTokenUnStaking.spec.js +++ /dev/null @@ -1,25 +0,0 @@ -const { test, expect } = require("@playwright/test"); -const { PreProposal } = require("./CommonFile/PreAction"); -const { pageLocators } = require("./CommonFile/Locator"); - -test('Test case 12: Successful Token UnStaking', async ({ page }) => { - - test.setTimeout(600000); //To Extend the time of test Execution - - 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 - - await page.click(pageLocators.ProposalExecutionAndDrop.DropProposal); // Click on Drop All Proposals - - await page.waitForTimeout(2000); //Wait For Drop All The Proposal - - 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/TC13_SuccessfulTokenWithdrawal.spec.js b/tests/TC13_SuccessfulTokenWithdrawal.spec.js deleted file mode 100644 index 9ec87cb..0000000 --- a/tests/TC13_SuccessfulTokenWithdrawal.spec.js +++ /dev/null @@ -1,24 +0,0 @@ -const { test, expect } = require("@playwright/test"); -const { PreProposal } = require("./CommonFile/PreAction"); -const { pageLocators } = require("./CommonFile/Locator"); -const { TezosTestData } = require("./CommonFile/TestData"); - -test('Test case 13: Successful Token Withdrawal', async ({ page }) => { - - test.setTimeout(600000); //To Extend the time of test Execution - - await PreProposal(page); //PreConditions Open URL and Open Mask DAO For Proposal - - 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 - - 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 - -}) \ No newline at end of file