Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests: Update testids #2784

Merged
merged 7 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions cypress/e2e/safe-apps/apps_list.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,44 @@ import * as safeapps from '../pages/safeapps.pages'
const myCustomAppTitle = 'Cypress Test App'
const myCustomAppDescrAdded = 'Cypress Test App Description'

describe('Safe Apps tests', () => {
describe('Safe Apps list tests', () => {
beforeEach(() => {
cy.clearLocalStorage()
cy.visit(constants.SEPOLIA_TEST_SAFE_4 + constants.appsUrl, { failOnStatusCode: false })
main.acceptCookies()
})

it('Verify app list can be filtered by app name [C56130]', () => {
it('Verify app list can be filtered by app name', () => {
// Wait for /safe-apps response
cy.intercept('GET', constants.appsEndpoint).then(() => {
safeapps.typeAppName(constants.appNames.walletConnect)
safeapps.verifyLinkName(safeapps.linkNames.logo)
})
})

it('Verify app list can be filtered by app description [C56131]', () => {
it('Verify app list can be filtered by app description', () => {
safeapps.typeAppName(constants.appNames.customContract)
safeapps.verifyLinkName(safeapps.linkNames.logo)
})

it('Verify error message is displayed when no app found [C56132]', () => {
it('Verify error message is displayed when no app found', () => {
safeapps.typeAppName(constants.appNames.noResults)
safeapps.verifyNoAppsTextPresent()
})

it('Verify apps can be pinned [C56133]', () => {
it('Verify apps can be pinned', () => {
safeapps.clearSearchAppInput()
safeapps.pinApp(safeapps.transactionBuilderStr)
safeapps.verifyPinnedAppCount(1)
})

it('Verify apps can be unpinned [C56134]', () => {
it('Verify apps can be unpinned', () => {
safeapps.pinApp(safeapps.transactionBuilderStr)
safeapps.pinApp(safeapps.transactionBuilderStr, false)
safeapps.verifyPinnedAppCount(0)
})

it('Verify there is an error when the app manifest is invalid [C56135]', () => {
it('Verify there is an error when the app manifest is invalid', () => {
cy.intercept('GET', constants.invalidAppUrl, {
name: constants.testAppData.name,
})
Expand All @@ -52,7 +52,7 @@ describe('Safe Apps tests', () => {
safeapps.verifyAppNotSupportedMsg()
})

it('Verify an app can be added to the list within the custom apps section [C56136]', () => {
it('Verify an app can be added to the list within the custom apps section', () => {
cy.intercept('GET', constants.validAppUrlJson, {
name: constants.testAppData.name,
description: constants.testAppData.descr,
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/safe-apps/browser_permissions.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ describe('Browser permissions tests', () => {
main.acceptCookies()
})

it('Verify a permissions slide to the user is displayed [C56137]', () => {
it('Verify a permissions slide to the user is displayed', () => {
safeapps.clickOnContinueBtn()
safeapps.verifyCameraCheckBoxExists()
safeapps.verifyMicrofoneCheckBoxExists()
})

it('Verify the selection can be changed, accepted and stored [C56138]', () => {
it('Verify the selection can be changed, accepted and stored', () => {
safeapps.verifyMicrofoneCheckBoxExists().click()
safeapps.clickOnContinueBtn()
safeapps.verifyWarningDefaultAppMsgIsDisplayed()
Expand Down
18 changes: 9 additions & 9 deletions cypress/e2e/safe-apps/drain_account.spec.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as constants from '../../support/constants'
import * as main from '../pages/main.page'
import * as safeapps from '../pages/safeapps.pages'

describe('Drain Account Safe App tests', { defaultCommandTimeout: 12000 }, () => {
describe('Drain Account tests', { defaultCommandTimeout: 12000 }, () => {
const appUrl = constants.drainAccount_url
const iframeSelector = `iframe[id="iframe-${appUrl}"]`
const visitUrl = `/apps/open?safe=${constants.GOERLI_SAFE_APPS_SAFE}&appUrl=${encodeURIComponent(appUrl)}`
Expand All @@ -19,7 +19,7 @@ describe('Drain Account Safe App tests', { defaultCommandTimeout: 12000 }, () =>
safeapps.clickOnContinueBtn()
})

it('Verify drain can be created [C56627]', () => {
it('Verify drain can be created', () => {
cy.enter(iframeSelector).then((getBody) => {
getBody().findByLabelText(safeapps.recipientStr).type(constants.SAFE_APP_ADDRESS_2)
getBody().findAllByText(safeapps.transferEverythingStr).click()
Expand All @@ -28,7 +28,7 @@ describe('Drain Account Safe App tests', { defaultCommandTimeout: 12000 }, () =>
cy.findByRole('button', { name: safeapps.testNativeTransfer2 })
})

it('Verify partial drain can be created [C56628]', () => {
it('Verify partial drain can be created', () => {
cy.enter(iframeSelector).then((getBody) => {
getBody().findByLabelText(safeapps.selectAllRowsChbxStr).click()
getBody().findAllByLabelText(safeapps.selectRowChbxStr).eq(1).click()
Expand All @@ -40,7 +40,7 @@ describe('Drain Account Safe App tests', { defaultCommandTimeout: 12000 }, () =>
cy.findByRole('button', { name: safeapps.testNativeTransfer1 })
})

it('Verify a drain can be created when a ENS is specified [C56629]', () => {
it('Verify a drain can be created when a ENS is specified', () => {
cy.enter(iframeSelector).then((getBody) => {
getBody().findByLabelText(safeapps.recipientStr).type('goerli-test-safe.eth').wait(2000)
getBody().findAllByText(safeapps.transferEverythingStr).click()
Expand All @@ -50,7 +50,7 @@ describe('Drain Account Safe App tests', { defaultCommandTimeout: 12000 }, () =>
})

// TODO: Adjust safe - owner
it.skip('Verify when cancelling a drain, previous data is preserved [C56630]', () => {
it.skip('Verify when cancelling a drain, previous data is preserved', () => {
cy.enter(iframeSelector).then((getBody) => {
getBody().findByLabelText(safeapps.recipientStr).type(constants.SAFE_APP_ADDRESS_2)
getBody().findAllByText(safeapps.transferEverythingStr).click()
Expand All @@ -61,30 +61,30 @@ describe('Drain Account Safe App tests', { defaultCommandTimeout: 12000 }, () =>
})
})

it('Verify a drain cannot be created with no recipient selected [C56631]', () => {
it('Verify a drain cannot be created with no recipient selected', () => {
cy.enter(iframeSelector).then((getBody) => {
getBody().findAllByText(safeapps.transferEverythingStr).click()
getBody().findByText(safeapps.validRecipientAddressStr)
})
})

it('Verify a drain cannot be created with invalid recipient selected [C56632]', () => {
it('Verify a drain cannot be created with invalid recipient selected', () => {
cy.enter(iframeSelector).then((getBody) => {
getBody().findByLabelText(safeapps.recipientStr).type(constants.SAFE_APP_ADDRESS_2.substring(1))
getBody().findAllByText(safeapps.transferEverythingStr).click()
getBody().findByText(safeapps.validRecipientAddressStr)
})
})

it('Verify a drain cannot be created when no assets are selected [C56633]', () => {
it('Verify a drain cannot be created when no assets are selected', () => {
cy.enter(iframeSelector).then((getBody) => {
getBody().findByLabelText(safeapps.selectAllRowsChbxStr).click()
getBody().findByLabelText(safeapps.recipientStr).type(constants.SAFE_APP_ADDRESS_2)
getBody().findAllByText(safeapps.noTokensSelectedStr).should('be.visible')
})
})

it('should not allow to perform a drain when no assets and recipient are selected', () => {
it('Verify a drain cannot be created when no assets and recipient are selected', () => {
cy.enter(iframeSelector).then((getBody) => {
getBody().findByLabelText(safeapps.selectAllRowsChbxStr).click()
getBody().findAllByText(safeapps.noTokensSelectedStr).should('be.visible')
Expand Down
8 changes: 4 additions & 4 deletions cypress/e2e/safe-apps/info_modal.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@ import * as constants from '../../support/constants'
import * as main from '../pages/main.page'
import * as safeapps from '../pages/safeapps.pages'

describe('Safe Apps info modal tests', () => {
describe('Info modal tests', () => {
beforeEach(() => {
cy.clearLocalStorage()
cy.visit(constants.SEPOLIA_TEST_SAFE_5 + constants.appsUrl, { failOnStatusCode: false })
main.acceptCookies()
})

it('Verify the disclaimer is displayed when a Safe App is opened [C56139]', () => {
it('Verify the disclaimer is displayed when a Safe App is opened', () => {
safeapps.clickOnApp(safeapps.transactionBuilderStr)
safeapps.clickOnOpenSafeAppBtn()
})

// Skip tests due to changed logic
// TODO: Discuss furthers
it.skip('Verify the permissions slide is shown if the app require permissions [C56140]', () => {
it.skip('Verify the permissions slide is shown if the app require permissions', () => {
safeapps.clickOnContinueBtn()
cy.wait(500) // wait for the animation to finish
safeapps.verifyCameraCheckBoxExists()
})

it.skip('Verify the permissions and consents decision are stored when accepted [C56141]', () => {
it.skip('Verify the permissions and consents decision are stored when accepted', () => {
safeapps.storeAndVerifyPermissions()
})
})
18 changes: 9 additions & 9 deletions cypress/e2e/safe-apps/permissions_settings.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ let $dapps = []
const app1 = 'https://app1.com'
const app3 = 'https://app3.com'

describe('Safe Apps permissions settings tests', () => {
describe('Permissions settings tests', () => {
before(() => {
cy.clearLocalStorage()
cy.on('window:before:load', (window) => {
Expand Down Expand Up @@ -49,18 +49,18 @@ describe('Safe Apps permissions settings tests', () => {
main.acceptCookies()
})

it('Verify for each stored app the permissions configuration is shown [C56142]', () => {
it('Verify for each stored app the permissions configuration is shown', () => {
cy.findAllByRole('heading', { level: 5 }).should('have.length', 4)
})

describe('Permissions for each app', () => {
describe('Permissions for each Safe app', () => {
before(() => {
cy.get(safeapps.gridItem).then((items) => {
$dapps = items
})
})

it('Verify that app1 has camera, full screen and geo permissions [C56143]', () => {
it('Verify that app1 has camera, full screen and geo permissions', () => {
const app1Data = [
'app1',
safeapps.permissionCheckboxNames.camera,
Expand All @@ -74,7 +74,7 @@ describe('Safe Apps permissions settings tests', () => {
main.verifyCheckboxeState(safeapps.permissionCheckboxes.fullscreen, 0, constants.checkboxStates.checked)
})

it('Verify that app2 has address book and microphone permissions [C56144]', () => {
it('Verify that app2 has address book and microphone permissions', () => {
const app2Data = [
'app2',
safeapps.permissionCheckboxNames.addressbook,
Expand All @@ -86,21 +86,21 @@ describe('Safe Apps permissions settings tests', () => {
main.verifyCheckboxeState(safeapps.permissionCheckboxes.addressbook, 0, constants.checkboxStates.checked)
})

it('Verify that app3 has camera permissions [C56145]', () => {
it('Verify that app3 has camera permissions', () => {
const app3Data = ['app3', safeapps.permissionCheckboxNames.camera]

main.checkTextsExistWithinElement($dapps[2], app3Data)
main.verifyCheckboxeState(safeapps.permissionCheckboxes.camera, 1, constants.checkboxStates.unchecked)
})

it('Verify that app4 has address book permissions [C56146]', () => {
it('Verify that app4 has address book permissions', () => {
const app4Data = ['app4', safeapps.permissionCheckboxNames.addressbook]

main.checkTextsExistWithinElement($dapps[3], app4Data)
main.verifyCheckboxeState(safeapps.permissionCheckboxes.addressbook, 1, constants.checkboxStates.checked)
})

it('Verify Allow all or Clear all the checkboxes at once is permitted [C56147]', () => {
it('Verify Allow all or Clear all the checkboxes at once is permitted', () => {
safeapps.uncheckAllPermissions($dapps[1])
main.verifyCheckboxeState(safeapps.permissionCheckboxes.addressbook, 0, constants.checkboxStates.unchecked)
main.verifyCheckboxeState(safeapps.permissionCheckboxes.microphone, 0, constants.checkboxStates.unchecked)
Expand All @@ -110,7 +110,7 @@ describe('Safe Apps permissions settings tests', () => {
main.verifyCheckboxeState(safeapps.permissionCheckboxes.microphone, 0, constants.checkboxStates.checked)
})

it('Verify it is permitted to remove apps and reflect it in the localStorage [C56148]', () => {
it('Verify it is permitted to remove apps and reflect it in the localStorage', () => {
cy.wrap($dapps[0]).find('svg').last().click()
cy.wrap($dapps[2])
.find('svg')
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/safe-apps/preview_drawer.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import * as constants from '../../support/constants'
import * as main from '../pages/main.page'
import * as safeapps from '../pages/safeapps.pages'

describe('Safe Apps info modal tests', () => {
describe('Preview drawer tests', () => {
beforeEach(() => {
cy.clearLocalStorage()
cy.visit(`/${constants.SEPOLIA_TEST_SAFE_5}/apps`, { failOnStatusCode: false })
main.acceptCookies()
})

it('Verify the preview drawer is displayed when opening a Safe App from the app list [C56149]', () => {
it('Verify the preview drawer is displayed when opening a Safe App from the app list', () => {
safeapps.clickOnApp(safeapps.transactionBuilderStr)

cy.findByRole('presentation').within(() => {
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/safe-apps/safe_permissions.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('Safe permissions system tests', () => {
})
})

it('Verify that requesting permissions with wallet_requestPermissions shows the permissions prompt and return the permissions on accept [C56150]', () => {
it('Verify that requesting permissions with wallet_requestPermissions shows the permissions prompt and return the permissions on accept', () => {
cy.visitSafeApp(constants.testAppUrl + constants.requestPermissionsUrl)
main.acceptCookies()
safeapps.clickOnContinueBtn()
Expand All @@ -38,7 +38,7 @@ describe('Safe permissions system tests', () => {
})
})

it('Verify that trying to get the current permissions with wallet_getPermissions returns the current permissions [C56151]', () => {
it('Verify that trying to get the current permissions with wallet_getPermissions returns the current permissions', () => {
cy.on('window:before:load', (window) => {
window.localStorage.setItem(
constants.SAFE_PERMISSIONS_KEY,
Expand Down
Loading
Loading