From 002522ded161ad756d29978f4ccd9a0cc7c5c0ff Mon Sep 17 00:00:00 2001 From: SamuelSalas Date: Tue, 20 Aug 2024 17:19:18 -0600 Subject: [PATCH] test: Update ios simulator to iphone 15 (#10636) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## **Description** We want to update the simulator where the E2E tests run from iphone 13 pro to iphone 15. ## **Related issues** Fixes: ## **Manual testing steps** 1. Go to this page... 2. 3. ## **Screenshots/Recordings** https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/64f5e6fd-01a5-434c-9574-f7775df2998e ### **Before** ### **After** ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --------- Co-authored-by: Curtis David --- .detoxrc.js | 2 +- e2e/api-specs/ConfirmationsRejectionRule.js | 11 +++++++++++ e2e/pages/modals/SpamFilterModal.js | 19 +++++++++++++++++++ .../Modals/SpamFilterModal.selectors.js | 7 +++++++ 4 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 e2e/pages/modals/SpamFilterModal.js create mode 100644 e2e/selectors/Modals/SpamFilterModal.selectors.js diff --git a/.detoxrc.js b/.detoxrc.js index 38584d0a6be5..d637d3c937c0 100644 --- a/.detoxrc.js +++ b/.detoxrc.js @@ -64,7 +64,7 @@ module.exports = { 'ios.simulator': { type: 'ios.simulator', device: { - type: 'iPhone 13 Pro', + type: 'iPhone 15 Pro', }, }, 'android.bitrise.emulator': { diff --git a/e2e/api-specs/ConfirmationsRejectionRule.js b/e2e/api-specs/ConfirmationsRejectionRule.js index 7d15ed0b364a..0a3e472359d6 100644 --- a/e2e/api-specs/ConfirmationsRejectionRule.js +++ b/e2e/api-specs/ConfirmationsRejectionRule.js @@ -6,6 +6,7 @@ import Matchers from '../utils/Matchers'; import Gestures from '../utils/Gestures'; import ConnectModal from '../pages/modals/ConnectModal'; import AssetWatchModal from '../pages/modals/AssetWatchModal'; +import SpamFilterModal from '../pages/modals/SpamFilterModal'; // eslint-disable-next-line import/no-nodejs-modules import fs from 'fs'; @@ -62,6 +63,16 @@ export default class ConfirmationsRejectRule { await ConnectModal.tapConnectButton(); await Assertions.checkIfNotVisible(ConnectModal.container); await TestHelpers.delay(3000); + + try { + await Assertions.checkIfVisible(SpamFilterModal.title); + await SpamFilterModal.tapCloseButton(); + await Assertions.checkIfNotVisible(SpamFilterModal.title); + } catch { + /* eslint-disable no-console */ + + console.log('The spam modal is not visible'); + } } // we need this because mobile doesnt support just raw json signTypedData, it requires a stringified version diff --git a/e2e/pages/modals/SpamFilterModal.js b/e2e/pages/modals/SpamFilterModal.js new file mode 100644 index 000000000000..9945ed911435 --- /dev/null +++ b/e2e/pages/modals/SpamFilterModal.js @@ -0,0 +1,19 @@ +import Matchers from '../../utils/Matchers'; +import Gestures from '../../utils/Gestures'; +import { SpamFilterModalSelectorText } from '../../selectors/Modals/SpamFilterModal.selectors'; + +class SpamFilterModal { + get title() { + return Matchers.getElementByText(SpamFilterModalSelectorText.TITLE); + } + + get cancelButtonText() { + return Matchers.getElementByText(SpamFilterModalSelectorText.CANCEL_BUTTON); + } + + async tapCloseButton() { + await Gestures.waitAndTap(this.cancelButtonText); + } +} + +export default new SpamFilterModal(); diff --git a/e2e/selectors/Modals/SpamFilterModal.selectors.js b/e2e/selectors/Modals/SpamFilterModal.selectors.js new file mode 100644 index 000000000000..66679004b138 --- /dev/null +++ b/e2e/selectors/Modals/SpamFilterModal.selectors.js @@ -0,0 +1,7 @@ +import enContent from '../../../locales/languages/en.json'; + +// eslint-disable-next-line import/prefer-default-export +export const SpamFilterModalSelectorText = { + TITLE: enContent.spam_filter.title, + CANCEL_BUTTON: enContent.spam_filter.cancel, +};