From b9810162a2873bfdeeb659f3269c8fad05ff4de6 Mon Sep 17 00:00:00 2001 From: Miklos Mandoki Date: Fri, 13 Feb 2026 11:06:41 +1100 Subject: [PATCH 1/2] refactor: only spec files in /specs --- .github/dependabot.yml | 18 +++++++ eslint.config.mjs | 2 +- global-setup.ts | 4 +- playwright.config.ts | 6 +-- run/test/{specs => }/locators/browsers.ts | 0 run/test/{specs => }/locators/conversation.ts | 16 +++--- .../locators/disappearing_messages.ts | 4 +- run/test/{specs => }/locators/external.ts | 0 run/test/{specs => }/locators/global.ts | 2 +- .../{specs => }/locators/global_search.ts | 2 +- run/test/{specs => }/locators/groups.ts | 14 ++--- run/test/{specs => }/locators/home.ts | 4 +- run/test/{specs => }/locators/index.ts | 6 +-- run/test/{specs => }/locators/network_page.ts | 6 +-- run/test/{specs => }/locators/onboarding.ts | 2 +- run/test/{specs => }/locators/settings.ts | 2 +- .../locators/start_conversation.ts | 2 +- .../{specs => }/media/profile_picture.jpg | Bin run/test/{specs => }/media/test_file.pdf | Bin run/test/{specs => }/media/test_image.jpg | Bin run/test/{specs => }/media/test_video.mp4 | Bin .../media/test_video_thumbnail.png | Bin run/test/specs/app_disguise_icons.spec.ts | 8 +-- run/test/specs/app_disguise_set.spec.ts | 26 ++++----- run/test/specs/check_avatar_color.spec.ts | 14 ++--- run/test/specs/community_emoji_react.spec.ts | 8 +-- run/test/specs/community_requests_off.spec.ts | 10 ++-- run/test/specs/community_requests_on.spec.ts | 16 +++--- run/test/specs/community_tests_image.spec.ts | 10 ++-- run/test/specs/community_tests_join.spec.ts | 10 ++-- run/test/specs/cta_donate_review.spec.ts | 28 +++++----- run/test/specs/cta_donate_time.spec.ts | 18 +++---- run/test/specs/disappear_after_read.spec.ts | 10 ++-- run/test/specs/disappear_after_send.spec.ts | 10 ++-- .../specs/disappear_after_send_groups.spec.ts | 25 +++++---- .../disappear_after_send_note_to_self.spec.ts | 14 ++--- .../disappear_after_send_off_1o1.spec.ts | 30 +++++------ run/test/specs/disappearing_call.spec.ts | 22 ++++---- .../disappearing_community_invite.spec.ts | 20 +++---- run/test/specs/disappearing_gif.spec.ts | 8 +-- run/test/specs/disappearing_image.spec.ts | 8 +-- run/test/specs/disappearing_link.spec.ts | 24 ++++----- run/test/specs/disappearing_video.spec.ts | 8 +-- run/test/specs/disappearing_voice.spec.ts | 8 +-- run/test/specs/donate.spec.ts | 20 +++---- .../group_disappearing_messages_gif.spec.ts | 8 +-- .../group_disappearing_messages_image.spec.ts | 8 +-- .../group_disappearing_messages_link.spec.ts | 20 +++---- ...roup_disappearing_messages_members.spec.ts | 8 +-- .../group_disappearing_messages_video.spec.ts | 8 +-- .../group_disappearing_messages_voice.spec.ts | 6 +-- run/test/specs/group_message_delete.spec.ts | 14 ++--- run/test/specs/group_message_document.spec.ts | 8 +-- run/test/specs/group_message_gif.spec.ts | 8 +-- run/test/specs/group_message_image.spec.ts | 8 +-- .../specs/group_message_link_preview.spec.ts | 22 ++++---- .../specs/group_message_long_text.spec.ts | 6 +-- run/test/specs/group_message_unsend.spec.ts | 14 ++--- run/test/specs/group_message_video.spec.ts | 8 +-- run/test/specs/group_message_voice.spec.ts | 8 +-- run/test/specs/group_reaction.spec.ts | 6 +-- .../specs/group_tests_add_contact.spec.ts | 26 ++++----- ...oup_tests_change_group_description.spec.ts | 18 +++---- .../group_tests_change_group_name.spec.ts | 20 +++---- .../specs/group_tests_create_group.spec.ts | 6 +-- .../group_tests_create_group_banner.spec.ts | 10 ++-- .../specs/group_tests_delete_group.spec.ts | 28 +++++----- .../group_tests_edit_group_banner.spec.ts | 8 +-- .../group_tests_invite_contact_banner.spec.ts | 10 ++-- .../specs/group_tests_kick_member.spec.ts | 29 +++++----- .../specs/group_tests_leave_group.spec.ts | 22 ++++---- run/test/specs/group_tests_mentions.spec.ts | 6 +-- run/test/specs/invite_a_friend_share.spec.ts | 10 ++-- .../specs/landing_page_new_account.spec.ts | 6 +-- .../landing_page_restore_account.spec.ts | 6 +-- run/test/specs/linked_device.spec.ts | 10 ++-- .../specs/linked_device_avatar_color.spec.ts | 8 +-- .../specs/linked_device_block_user.spec.ts | 22 ++++---- .../linked_device_change_username.spec.ts | 10 ++-- .../specs/linked_device_create_group.spec.ts | 30 +++++------ .../linked_device_delete_message.spec.ts | 16 +++--- .../linked_device_hide_note_to_self.spec.ts | 18 +++---- ...inked_device_profile_picture_syncs.spec.ts | 6 +-- .../specs/linked_device_restore_group.spec.ts | 12 ++--- .../linked_device_unsend_message.spec.ts | 16 +++--- run/test/specs/linked_group_leave.spec.ts | 26 +++++---- .../specs/message_check_performance.spec.ts | 4 +- .../message_community_invitation.spec.ts | 26 +++++---- run/test/specs/message_deletion.spec.ts | 14 ++--- run/test/specs/message_document.spec.ts | 8 +-- run/test/specs/message_gif.spec.ts | 8 +-- run/test/specs/message_image.spec.ts | 6 +-- run/test/specs/message_length.spec.ts | 18 +++---- run/test/specs/message_link_preview.spec.ts | 22 ++++---- run/test/specs/message_long_text.spec.ts | 10 ++-- run/test/specs/message_reaction.spec.ts | 6 +-- .../specs/message_requests_accept.spec.ts | 18 +++---- ...message_requests_accept_text_reply.spec.ts | 30 +++++------ run/test/specs/message_requests_block.spec.ts | 24 ++++----- .../specs/message_requests_clear_all.spec.ts | 14 ++--- .../specs/message_requests_decline.spec.ts | 21 ++++---- .../specs/message_requests_delete.spec.ts | 17 +++--- run/test/specs/message_unsend.spec.ts | 14 ++--- run/test/specs/message_video.spec.ts | 8 +-- run/test/specs/message_voice.spec.ts | 8 +-- .../specs/network_page_link_network.spec.ts | 20 +++---- .../specs/network_page_link_staking.spec.ts | 20 +++---- .../specs/network_page_refresh_page.spec.ts | 10 ++-- run/test/specs/network_page_values.spec.ts | 10 ++-- .../onboarding_incorrect_seed.spec.ts | 6 +-- .../onboarding_long_name.spec.ts | 6 +-- .../onboarding_no_name.spec.ts | 6 +-- .../onboarding_no_seed.spec.ts | 6 +-- run/test/specs/onboarding_pp.spec.ts | 10 ++-- run/test/specs/onboarding_tos.spec.ts | 10 ++-- .../onboarding_wrong_seed.spec.ts | 6 +-- run/test/specs/ons_resolve.spec.ts | 12 ++--- run/test/specs/review_negative.spec.ts | 26 ++++----- run/test/specs/review_once.spec.ts | 18 +++---- run/test/specs/review_positive.spec.ts | 25 ++++----- run/test/specs/review_triggers.spec.ts | 14 ++--- run/test/specs/upm_homescreen.spec.ts | 6 +-- ...er_actions_block_conversation_list.spec.ts | 18 +++---- ...actions_block_conversation_options.spec.ts | 20 +++---- ...ser_actions_change_profile_picture.spec.ts | 6 +-- .../user_actions_change_username.spec.ts | 15 +++--- .../specs/user_actions_create_contact.spec.ts | 16 +++--- .../specs/user_actions_create_user.spec.ts | 4 +- .../user_actions_delete_contact_ucs.spec.ts | 14 ++--- .../user_actions_delete_conversation.spec.ts | 14 +++-- ...er_actions_delete_conversation_ucs.spec.ts | 16 +++--- .../user_actions_hide_note_to_self.spec.ts | 24 ++++----- ...ser_actions_hide_recovery_password.spec.ts | 18 +++---- .../specs/user_actions_read_status.spec.ts | 10 ++-- .../specs/user_actions_set_nickname.spec.ts | 14 ++--- .../user_actions_share_to_session.spec.ts | 16 +++--- .../specs/user_actions_unblock_user.spec.ts | 18 +++---- run/test/specs/visual_message_bubbles.spec.ts | 10 ++-- run/test/specs/visual_settings.spec.ts | 12 ++--- run/test/specs/voice_calls.spec.ts | 50 ++++++++---------- .../specs/warning_modal_new_account.spec.ts | 13 ++--- .../warning_modal_restore_account.spec.ts | 13 ++--- run/test/{specs => }/state_builder/index.ts | 2 +- .../{specs => }/utils/allure/allureHelpers.ts | 4 +- run/test/{specs => }/utils/allure/closeRun.ts | 2 +- .../{specs => }/utils/allure/publishReport.ts | 2 +- run/test/{specs => }/utils/binaries.ts | 0 .../{specs => }/utils/capabilities_android.ts | 0 .../{specs => }/utils/capabilities_ios.ts | 2 +- run/test/{specs => }/utils/check_colour.ts | 0 .../{specs => }/utils/click_by_coordinates.ts | 4 +- .../utils/copy_file_to_simulator.ts | 4 +- run/test/{specs => }/utils/create_account.ts | 4 +- run/test/{specs => }/utils/create_contact.ts | 6 +-- run/test/{specs => }/utils/create_group.ts | 18 +++---- run/test/{specs => }/utils/devnet.ts | 4 +- .../utils/disappearing_control_messages.ts | 29 +++++----- run/test/{specs => }/utils/get_account_id.ts | 2 +- .../{specs => }/utils/handle_first_open.ts | 2 +- run/test/{specs => }/utils/index.ts | 0 run/test/{specs => }/utils/join_community.ts | 2 +- run/test/{specs => }/utils/link_device.ts | 2 +- run/test/{specs => }/utils/network_api.ts | 0 run/test/{specs => }/utils/open_app.ts | 2 +- run/test/{specs => }/utils/permissions.ts | 2 +- run/test/{specs => }/utils/restore_account.ts | 6 +-- run/test/{specs => }/utils/run_on.ts | 0 .../{specs => }/utils/screenshot_helper.ts | 2 +- .../utils/set_disappearing_messages.ts | 4 +- run/test/{specs => }/utils/sleep_for.ts | 0 run/test/{specs => }/utils/test_setup.ts | 0 run/test/{specs => }/utils/time_travel.ts | 0 run/test/{specs => }/utils/utilities.ts | 2 +- .../{specs => }/utils/verify_screenshots.ts | 4 +- run/types/DeviceWrapper.ts | 43 ++++++--------- run/types/sessionIt.ts | 10 ++-- scripts/cleanup_ios_simulators.ts | 2 +- scripts/create_ios_simulators.ts | 4 +- 178 files changed, 949 insertions(+), 1013 deletions(-) create mode 100644 .github/dependabot.yml rename run/test/{specs => }/locators/browsers.ts (100%) rename run/test/{specs => }/locators/conversation.ts (97%) rename run/test/{specs => }/locators/disappearing_messages.ts (97%) rename run/test/{specs => }/locators/external.ts (100%) rename run/test/{specs => }/locators/global.ts (99%) rename run/test/{specs => }/locators/global_search.ts (93%) rename run/test/{specs => }/locators/groups.ts (95%) rename run/test/{specs => }/locators/home.ts (97%) rename run/test/{specs => }/locators/index.ts (98%) rename run/test/{specs => }/locators/network_page.ts (94%) rename run/test/{specs => }/locators/onboarding.ts (98%) rename run/test/{specs => }/locators/settings.ts (99%) rename run/test/{specs => }/locators/start_conversation.ts (98%) rename run/test/{specs => }/media/profile_picture.jpg (100%) rename run/test/{specs => }/media/test_file.pdf (100%) rename run/test/{specs => }/media/test_image.jpg (100%) rename run/test/{specs => }/media/test_video.mp4 (100%) rename run/test/{specs => }/media/test_video_thumbnail.png (100%) rename run/test/specs/{input_validations => }/onboarding_incorrect_seed.spec.ts (88%) rename run/test/specs/{input_validations => }/onboarding_long_name.spec.ts (90%) rename run/test/specs/{input_validations => }/onboarding_no_name.spec.ts (88%) rename run/test/specs/{input_validations => }/onboarding_no_seed.spec.ts (88%) rename run/test/specs/{input_validations => }/onboarding_wrong_seed.spec.ts (88%) rename run/test/{specs => }/state_builder/index.ts (99%) rename run/test/{specs => }/utils/allure/allureHelpers.ts (98%) rename run/test/{specs => }/utils/allure/closeRun.ts (98%) rename run/test/{specs => }/utils/allure/publishReport.ts (98%) rename run/test/{specs => }/utils/binaries.ts (100%) rename run/test/{specs => }/utils/capabilities_android.ts (100%) rename run/test/{specs => }/utils/capabilities_ios.ts (98%) rename run/test/{specs => }/utils/check_colour.ts (100%) rename run/test/{specs => }/utils/click_by_coordinates.ts (70%) rename run/test/{specs => }/utils/copy_file_to_simulator.ts (95%) rename run/test/{specs => }/utils/create_account.ts (96%) rename run/test/{specs => }/utils/create_contact.ts (92%) rename run/test/{specs => }/utils/create_group.ts (85%) rename run/test/{specs => }/utils/devnet.ts (97%) rename run/test/{specs => }/utils/disappearing_control_messages.ts (71%) rename run/test/{specs => }/utils/get_account_id.ts (92%) rename run/test/{specs => }/utils/handle_first_open.ts (97%) rename run/test/{specs => }/utils/index.ts (100%) rename run/test/{specs => }/utils/join_community.ts (93%) rename run/test/{specs => }/utils/link_device.ts (97%) rename run/test/{specs => }/utils/network_api.ts (100%) rename run/test/{specs => }/utils/open_app.ts (99%) rename run/test/{specs => }/utils/permissions.ts (97%) rename run/test/{specs => }/utils/restore_account.ts (94%) rename run/test/{specs => }/utils/run_on.ts (100%) rename run/test/{specs => }/utils/screenshot_helper.ts (99%) rename run/test/{specs => }/utils/set_disappearing_messages.ts (96%) rename run/test/{specs => }/utils/sleep_for.ts (100%) rename run/test/{specs => }/utils/test_setup.ts (100%) rename run/test/{specs => }/utils/time_travel.ts (100%) rename run/test/{specs => }/utils/utilities.ts (98%) rename run/test/{specs => }/utils/verify_screenshots.ts (98%) diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..8096968fa4 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,18 @@ +# Get a single PR per month with all updates. +version: 2 +updates: + - package-ecosystem: 'npm' + directory: '/' + schedule: + interval: 'monthly' + target-branch: 'dev' + groups: + # One group to rule them all + monthly-updates: + patterns: + - '*' + + # Keep Node and pnpm pinned + ignore: + - dependency-name: 'node' + - dependency-name: 'pnpm' diff --git a/eslint.config.mjs b/eslint.config.mjs index fccbb7454b..772e5011cd 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -92,7 +92,7 @@ export default tseslint.config( }, }, { - files: ['run/test/specs/locators/*'], + files: ['run/test/locators/*'], rules: { 'perfectionist/sort-modules': 'error', }, diff --git a/global-setup.ts b/global-setup.ts index b6a0ef8057..cb10a4c5bd 100644 --- a/global-setup.ts +++ b/global-setup.ts @@ -1,7 +1,7 @@ import { FullConfig } from '@playwright/test'; -import { getNetworkTarget } from './run/test/specs/utils/devnet'; -import { SupportedPlatformsType } from './run/test/specs/utils/open_app'; +import { getNetworkTarget } from './run/test/utils/devnet'; +import { SupportedPlatformsType } from './run/test/utils/open_app'; export default async function globalSetup(_config: FullConfig) { const platform = process.env.PLATFORM as SupportedPlatformsType | undefined; diff --git a/playwright.config.ts b/playwright.config.ts index 3e3d64f7cd..4794411a8d 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -4,11 +4,7 @@ dotenv.config({ quiet: true }); import { defineConfig, ReporterDescription } from '@playwright/test'; import { allureResultsDir } from './run/constants/allure'; -import { - getRepeatEachCount, - getRetriesCount, - getWorkersCount, -} from './run/test/specs/utils/binaries'; +import { getRepeatEachCount, getRetriesCount, getWorkersCount } from './run/test/utils/binaries'; // NOTE: without this, the wrong source map is loaded and the stacktraces are all wrong // eslint-disable-next-line @typescript-eslint/no-require-imports diff --git a/run/test/specs/locators/browsers.ts b/run/test/locators/browsers.ts similarity index 100% rename from run/test/specs/locators/browsers.ts rename to run/test/locators/browsers.ts diff --git a/run/test/specs/locators/conversation.ts b/run/test/locators/conversation.ts similarity index 97% rename from run/test/specs/locators/conversation.ts rename to run/test/locators/conversation.ts index 8018d14ea1..7efc47b7d3 100644 --- a/run/test/specs/locators/conversation.ts +++ b/run/test/locators/conversation.ts @@ -1,8 +1,8 @@ -import type { DeviceWrapper } from '../../../types/DeviceWrapper'; +import type { DeviceWrapper } from '../../types/DeviceWrapper'; -import { testCommunityName } from '../../../constants/community'; -import { englishStrippedStr } from '../../../localizer/englishStrippedStr'; -import { StrategyExtractionObj } from '../../../types/testing'; +import { testCommunityName } from '../../constants/community'; +import { tStripped } from '../../localizer/lib'; +import { StrategyExtractionObj } from '../../types/testing'; import { getAppDisplayName } from '../utils/devnet'; import { LocatorsInterface } from './index'; @@ -489,9 +489,7 @@ export class MessageLengthOkayButton extends LocatorsInterface { export class MessageRequestAcceptDescription extends LocatorsInterface { public build() { - const messageRequestsAcceptDescription = englishStrippedStr( - 'messageRequestsAcceptDescription' - ).toString(); + const messageRequestsAcceptDescription = tStripped('messageRequestsAcceptDescription'); switch (this.platform) { case 'android': return { @@ -511,9 +509,7 @@ export class MessageRequestAcceptDescription extends LocatorsInterface { export class MessageRequestPendingDescription extends LocatorsInterface { public build() { - const messageRequestPendingDescription = englishStrippedStr( - 'messageRequestPendingDescription' - ).toString(); + const messageRequestPendingDescription = tStripped('messageRequestPendingDescription'); switch (this.platform) { case 'android': return { diff --git a/run/test/specs/locators/disappearing_messages.ts b/run/test/locators/disappearing_messages.ts similarity index 97% rename from run/test/specs/locators/disappearing_messages.ts rename to run/test/locators/disappearing_messages.ts index 251b3fb77e..d21db0384f 100644 --- a/run/test/specs/locators/disappearing_messages.ts +++ b/run/test/locators/disappearing_messages.ts @@ -1,10 +1,10 @@ import { LocatorsInterface } from '.'; -import { DeviceWrapper } from '../../../types/DeviceWrapper'; +import { DeviceWrapper } from '../../types/DeviceWrapper'; import { DISAPPEARING_TIMES, DisappearingOptions, StrategyExtractionObj, -} from '../../../types/testing'; +} from '../../types/testing'; export class DisableDisappearingMessages extends LocatorsInterface { public build(): StrategyExtractionObj { diff --git a/run/test/specs/locators/external.ts b/run/test/locators/external.ts similarity index 100% rename from run/test/specs/locators/external.ts rename to run/test/locators/external.ts diff --git a/run/test/specs/locators/global.ts b/run/test/locators/global.ts similarity index 99% rename from run/test/specs/locators/global.ts rename to run/test/locators/global.ts index ae7e2707b9..481e69211c 100644 --- a/run/test/specs/locators/global.ts +++ b/run/test/locators/global.ts @@ -1,4 +1,4 @@ -import { DeviceWrapper } from '../../../types/DeviceWrapper'; +import { DeviceWrapper } from '../../types/DeviceWrapper'; import { LocatorsInterface } from './index'; export class AccountIDDisplay extends LocatorsInterface { diff --git a/run/test/specs/locators/global_search.ts b/run/test/locators/global_search.ts similarity index 93% rename from run/test/specs/locators/global_search.ts rename to run/test/locators/global_search.ts index dfdfd637b6..2ece3811cf 100644 --- a/run/test/specs/locators/global_search.ts +++ b/run/test/locators/global_search.ts @@ -1,4 +1,4 @@ -import { StrategyExtractionObj } from '../../../types/testing'; +import { StrategyExtractionObj } from '../../types/testing'; import { LocatorsInterface } from './index'; export class CancelSearchButton extends LocatorsInterface { diff --git a/run/test/specs/locators/groups.ts b/run/test/locators/groups.ts similarity index 95% rename from run/test/specs/locators/groups.ts rename to run/test/locators/groups.ts index d6875d1609..bc3570c74d 100644 --- a/run/test/specs/locators/groups.ts +++ b/run/test/locators/groups.ts @@ -1,10 +1,10 @@ import type { UserNameType } from '@session-foundation/qa-seeder'; import { LocatorsInterface } from '.'; -import { englishStrippedStr } from '../../../localizer/englishStrippedStr'; -import { DeviceWrapper } from '../../../types/DeviceWrapper'; -import { StrategyExtractionObj } from '../../../types/testing'; -import { GROUPNAME } from '../../../types/testing'; +import { tStripped } from '../../localizer/lib'; +import { DeviceWrapper } from '../../types/DeviceWrapper'; +import { StrategyExtractionObj } from '../../types/testing'; +import { GROUPNAME } from '../../types/testing'; export class ConfirmRemovalButton extends LocatorsInterface { public build(): StrategyExtractionObj { @@ -194,7 +194,7 @@ export class LatestReleaseBanner extends LocatorsInterface { return { strategy: 'id', selector: 'Version warning banner', - text: englishStrippedStr('groupInviteVersion').toString(), + text: tStripped('groupInviteVersion'), } as const; case 'ios': // On iOS, the text is currently not exposed to Appium @@ -278,7 +278,7 @@ export class RecreateGroupBannerAdmin extends LocatorsInterface { return { strategy: 'accessibility id', selector: 'Legacy group banner', - text: englishStrippedStr('legacyGroupAfterDeprecationAdmin').toString(), + text: tStripped('legacyGroupAfterDeprecationAdmin'), } as const; } } @@ -288,7 +288,7 @@ export class RecreateGroupBannerMember extends LocatorsInterface { return { strategy: 'accessibility id', selector: 'Legacy group banner', - text: englishStrippedStr('legacyGroupAfterDeprecationMember').toString(), + text: tStripped('legacyGroupAfterDeprecationMember'), } as const; } } diff --git a/run/test/specs/locators/home.ts b/run/test/locators/home.ts similarity index 97% rename from run/test/specs/locators/home.ts rename to run/test/locators/home.ts index 11059f07f2..81cbfff879 100644 --- a/run/test/specs/locators/home.ts +++ b/run/test/locators/home.ts @@ -1,6 +1,6 @@ -import type { DeviceWrapper } from '../../../types/DeviceWrapper'; +import type { DeviceWrapper } from '../../types/DeviceWrapper'; -import { StrategyExtractionObj } from '../../../types/testing'; +import { StrategyExtractionObj } from '../../types/testing'; import { LocatorsInterface } from './index'; export class ConversationItem extends LocatorsInterface { diff --git a/run/test/specs/locators/index.ts b/run/test/locators/index.ts similarity index 98% rename from run/test/specs/locators/index.ts rename to run/test/locators/index.ts index e57bcb3818..2efd043ac0 100644 --- a/run/test/specs/locators/index.ts +++ b/run/test/locators/index.ts @@ -1,6 +1,6 @@ -import { ANDROID_XPATHS, IOS_XPATHS } from '../../../constants'; -import { DeviceWrapper } from '../../../types/DeviceWrapper'; -import { StrategyExtractionObj } from '../../../types/testing'; +import { ANDROID_XPATHS, IOS_XPATHS } from '../../constants'; +import { DeviceWrapper } from '../../types/DeviceWrapper'; +import { StrategyExtractionObj } from '../../types/testing'; import { getAppDisplayName } from '../utils/devnet'; import { SupportedPlatformsType } from '../utils/open_app'; diff --git a/run/test/specs/locators/network_page.ts b/run/test/locators/network_page.ts similarity index 94% rename from run/test/specs/locators/network_page.ts rename to run/test/locators/network_page.ts index b5673aa2a1..eb117411cc 100644 --- a/run/test/specs/locators/network_page.ts +++ b/run/test/locators/network_page.ts @@ -1,13 +1,13 @@ import { LocatorsInterface } from '.'; -import { englishStrippedStr } from '../../../localizer/englishStrippedStr'; -import { DeviceWrapper } from '../../../types/DeviceWrapper'; +import { tStripped } from '../../localizer/lib'; +import { DeviceWrapper } from '../../types/DeviceWrapper'; export class LastUpdatedTimeStamp extends LocatorsInterface { private expectedText: string; constructor(device: DeviceWrapper, relative_time: string) { super(device); - this.expectedText = englishStrippedStr('updated').withArgs({ relative_time }).toString(); + this.expectedText = tStripped('updated', { relative_time }); } public build() { switch (this.platform) { diff --git a/run/test/specs/locators/onboarding.ts b/run/test/locators/onboarding.ts similarity index 98% rename from run/test/specs/locators/onboarding.ts rename to run/test/locators/onboarding.ts index 5512025c82..ef6544b988 100644 --- a/run/test/specs/locators/onboarding.ts +++ b/run/test/locators/onboarding.ts @@ -1,4 +1,4 @@ -import { StrategyExtractionObj } from '../../../types/testing'; +import { StrategyExtractionObj } from '../../types/testing'; import { LocatorsInterface } from './index'; export class AccountRestoreButton extends LocatorsInterface { diff --git a/run/test/specs/locators/settings.ts b/run/test/locators/settings.ts similarity index 99% rename from run/test/specs/locators/settings.ts rename to run/test/locators/settings.ts index f4264c988b..04b3f933c8 100644 --- a/run/test/specs/locators/settings.ts +++ b/run/test/locators/settings.ts @@ -1,4 +1,4 @@ -import { StrategyExtractionObj } from '../../../types/testing'; +import { StrategyExtractionObj } from '../../types/testing'; import { LocatorsInterface } from './index'; export class AppDisguiseMeetingIcon extends LocatorsInterface { diff --git a/run/test/specs/locators/start_conversation.ts b/run/test/locators/start_conversation.ts similarity index 98% rename from run/test/specs/locators/start_conversation.ts rename to run/test/locators/start_conversation.ts index 5115c0309d..83dcf518fc 100644 --- a/run/test/specs/locators/start_conversation.ts +++ b/run/test/locators/start_conversation.ts @@ -1,4 +1,4 @@ -import { StrategyExtractionObj } from '../../../types/testing'; +import { StrategyExtractionObj } from '../../types/testing'; import { LocatorsInterface } from './index'; export class CloseButton extends LocatorsInterface { diff --git a/run/test/specs/media/profile_picture.jpg b/run/test/media/profile_picture.jpg similarity index 100% rename from run/test/specs/media/profile_picture.jpg rename to run/test/media/profile_picture.jpg diff --git a/run/test/specs/media/test_file.pdf b/run/test/media/test_file.pdf similarity index 100% rename from run/test/specs/media/test_file.pdf rename to run/test/media/test_file.pdf diff --git a/run/test/specs/media/test_image.jpg b/run/test/media/test_image.jpg similarity index 100% rename from run/test/specs/media/test_image.jpg rename to run/test/media/test_image.jpg diff --git a/run/test/specs/media/test_video.mp4 b/run/test/media/test_video.mp4 similarity index 100% rename from run/test/specs/media/test_video.mp4 rename to run/test/media/test_video.mp4 diff --git a/run/test/specs/media/test_video_thumbnail.png b/run/test/media/test_video_thumbnail.png similarity index 100% rename from run/test/specs/media/test_video_thumbnail.png rename to run/test/media/test_video_thumbnail.png diff --git a/run/test/specs/app_disguise_icons.spec.ts b/run/test/specs/app_disguise_icons.spec.ts index 6feb735f01..9340a75c2d 100644 --- a/run/test/specs/app_disguise_icons.spec.ts +++ b/run/test/specs/app_disguise_icons.spec.ts @@ -3,10 +3,10 @@ import { test, type TestInfo } from '@playwright/test'; import { TestSteps } from '../../types/allure'; import { bothPlatformsIt } from '../../types/sessionIt'; import { USERNAME } from '../../types/testing'; -import { AppearanceMenuItem, SelectAppIcon, UserSettings } from './locators/settings'; -import { newUser } from './utils/create_account'; -import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from './utils/open_app'; -import { verifyPageScreenshot } from './utils/verify_screenshots'; +import { AppearanceMenuItem, SelectAppIcon, UserSettings } from '../locators/settings'; +import { newUser } from '../utils/create_account'; +import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from '../utils/open_app'; +import { verifyPageScreenshot } from '../utils/verify_screenshots'; bothPlatformsIt({ title: 'Check app disguise icon layout', diff --git a/run/test/specs/app_disguise_set.spec.ts b/run/test/specs/app_disguise_set.spec.ts index 35ef2be12a..c610fadd90 100644 --- a/run/test/specs/app_disguise_set.spec.ts +++ b/run/test/specs/app_disguise_set.spec.ts @@ -1,25 +1,25 @@ import { test, type TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { TestSteps } from '../../types/allure'; import { bothPlatformsItSeparate } from '../../types/sessionIt'; import { USERNAME } from '../../types/testing'; -import { DisguisedApp } from './locators/external'; +import { DisguisedApp } from '../locators/external'; import { AppDisguiseMeetingIcon, AppearanceMenuItem, CloseAppButton, SelectAppIcon, UserSettings, -} from './locators/settings'; -import { sleepFor } from './utils'; -import { getAdbFullPath } from './utils/binaries'; -import { androidAppPackage } from './utils/capabilities_android'; -import { iOSBundleId } from './utils/capabilities_ios'; -import { newUser } from './utils/create_account'; -import { openAppOnPlatformSingleDevice, SupportedPlatformsType } from './utils/open_app'; -import { closeApp } from './utils/open_app'; -import { runScriptAndLog } from './utils/utilities'; +} from '../locators/settings'; +import { sleepFor } from '../utils'; +import { getAdbFullPath } from '../utils/binaries'; +import { androidAppPackage } from '../utils/capabilities_android'; +import { iOSBundleId } from '../utils/capabilities_ios'; +import { newUser } from '../utils/create_account'; +import { openAppOnPlatformSingleDevice, SupportedPlatformsType } from '../utils/open_app'; +import { closeApp } from '../utils/open_app'; +import { runScriptAndLog } from '../utils/utilities'; bothPlatformsItSeparate({ title: 'App disguise set icon', @@ -90,8 +90,8 @@ async function appDisguiseSetIconAndroid(platform: SupportedPlatformsType, testI await device.clickOnElementAll(new AppDisguiseMeetingIcon(device)); await test.step(TestSteps.VERIFY.SPECIFIC_MODAL('app disgusie'), async () => { await device.checkModalStrings( - englishStrippedStr('appIconAndNameChange').toString(), - englishStrippedStr('appIconAndNameChangeConfirmation').toString() + tStripped('appIconAndNameChange'), + tStripped('appIconAndNameChangeConfirmation') ); }); await test.step('Verify app icon changed', async () => { diff --git a/run/test/specs/check_avatar_color.spec.ts b/run/test/specs/check_avatar_color.spec.ts index 1a93022ef2..7b8dca142e 100644 --- a/run/test/specs/check_avatar_color.spec.ts +++ b/run/test/specs/check_avatar_color.spec.ts @@ -2,13 +2,13 @@ import { test, type TestInfo } from '@playwright/test'; import { TestSteps } from '../../types/allure'; import { bothPlatformsIt } from '../../types/sessionIt'; -import { ConversationSettings } from './locators/conversation'; -import { ConversationItem } from './locators/home'; -import { UserAvatar, UserSettings } from './locators/settings'; -import { open_Alice1_Bob1_friends } from './state_builder'; -import { sleepFor } from './utils'; -import { isSameColor } from './utils/check_colour'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +import { ConversationSettings } from '../locators/conversation'; +import { ConversationItem } from '../locators/home'; +import { UserAvatar, UserSettings } from '../locators/settings'; +import { open_Alice1_Bob1_friends } from '../state_builder'; +import { sleepFor } from '../utils'; +import { isSameColor } from '../utils/check_colour'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Check placeholder avatar color', diff --git a/run/test/specs/community_emoji_react.spec.ts b/run/test/specs/community_emoji_react.spec.ts index b892079215..fb80818368 100644 --- a/run/test/specs/community_emoji_react.spec.ts +++ b/run/test/specs/community_emoji_react.spec.ts @@ -3,10 +3,10 @@ import { test, type TestInfo } from '@playwright/test'; import { testCommunityLink, testCommunityName } from '../../constants/community'; import { TestSteps } from '../../types/allure'; import { bothPlatformsIt } from '../../types/sessionIt'; -import { EmojiReactsPill, FirstEmojiReact, MessageBody } from './locators/conversation'; -import { open_Alice1_Bob1_friends } from './state_builder'; -import { joinCommunity } from './utils/join_community'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +import { EmojiReactsPill, FirstEmojiReact, MessageBody } from '../locators/conversation'; +import { open_Alice1_Bob1_friends } from '../state_builder'; +import { joinCommunity } from '../utils/join_community'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Send emoji react community', diff --git a/run/test/specs/community_requests_off.spec.ts b/run/test/specs/community_requests_off.spec.ts index 5575b0ea80..83f598b194 100644 --- a/run/test/specs/community_requests_off.spec.ts +++ b/run/test/specs/community_requests_off.spec.ts @@ -4,11 +4,11 @@ import { USERNAME } from '@session-foundation/qa-seeder'; import { testCommunityLink, testCommunityName } from '../../constants/community'; import { TestSteps } from '../../types/allure'; import { bothPlatformsIt } from '../../types/sessionIt'; -import { CommunityMessageAuthor, UPMMessageButton } from './locators/conversation'; -import { sleepFor } from './utils'; -import { newUser } from './utils/create_account'; -import { joinCommunity } from './utils/join_community'; -import { closeApp, openAppTwoDevices, SupportedPlatformsType } from './utils/open_app'; +import { CommunityMessageAuthor, UPMMessageButton } from '../locators/conversation'; +import { sleepFor } from '../utils'; +import { newUser } from '../utils/create_account'; +import { joinCommunity } from '../utils/join_community'; +import { closeApp, openAppTwoDevices, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Community message requests off', diff --git a/run/test/specs/community_requests_on.spec.ts b/run/test/specs/community_requests_on.spec.ts index 1a7a53b89a..6238127f3a 100644 --- a/run/test/specs/community_requests_on.spec.ts +++ b/run/test/specs/community_requests_on.spec.ts @@ -4,7 +4,7 @@ import { USERNAME } from '@session-foundation/qa-seeder'; import { testCommunityLink, testCommunityName } from '../../constants/community'; import { TestSteps } from '../../types/allure'; import { bothPlatformsIt } from '../../types/sessionIt'; -import { CloseSettings } from './locators'; +import { CloseSettings } from '../locators'; import { CommunityMessageAuthor, ConversationHeaderName, @@ -12,13 +12,13 @@ import { MessageRequestAcceptDescription, MessageRequestPendingDescription, UPMMessageButton, -} from './locators/conversation'; -import { MessageRequestsBanner } from './locators/home'; -import { CommunityMessageRequestSwitch, PrivacyMenuItem, UserSettings } from './locators/settings'; -import { sleepFor } from './utils'; -import { newUser } from './utils/create_account'; -import { joinCommunity } from './utils/join_community'; -import { closeApp, openAppTwoDevices, SupportedPlatformsType } from './utils/open_app'; +} from '../locators/conversation'; +import { MessageRequestsBanner } from '../locators/home'; +import { CommunityMessageRequestSwitch, PrivacyMenuItem, UserSettings } from '../locators/settings'; +import { sleepFor } from '../utils'; +import { newUser } from '../utils/create_account'; +import { joinCommunity } from '../utils/join_community'; +import { closeApp, openAppTwoDevices, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Community message requests on', diff --git a/run/test/specs/community_tests_image.spec.ts b/run/test/specs/community_tests_image.spec.ts index d6e83c3a41..3858870c33 100644 --- a/run/test/specs/community_tests_image.spec.ts +++ b/run/test/specs/community_tests_image.spec.ts @@ -3,11 +3,11 @@ import { test, type TestInfo } from '@playwright/test'; import { testCommunityLink, testCommunityName } from '../../constants/community'; import { TestSteps } from '../../types/allure'; import { bothPlatformsIt } from '../../types/sessionIt'; -import { MessageBody } from './locators/conversation'; -import { open_Alice1_Bob1_friends } from './state_builder'; -import { sleepFor } from './utils'; -import { joinCommunity } from './utils/join_community'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +import { MessageBody } from '../locators/conversation'; +import { open_Alice1_Bob1_friends } from '../state_builder'; +import { sleepFor } from '../utils'; +import { joinCommunity } from '../utils/join_community'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Send image to community', diff --git a/run/test/specs/community_tests_join.spec.ts b/run/test/specs/community_tests_join.spec.ts index c693693f9b..d07d4d9853 100644 --- a/run/test/specs/community_tests_join.spec.ts +++ b/run/test/specs/community_tests_join.spec.ts @@ -3,11 +3,11 @@ import { test, type TestInfo } from '@playwright/test'; import { testCommunityLink, testCommunityName } from '../../constants/community'; import { TestSteps } from '../../types/allure'; import { bothPlatformsIt } from '../../types/sessionIt'; -import { ConversationItem } from './locators/home'; -import { open_Alice2 } from './state_builder'; -import { sleepFor } from './utils'; -import { joinCommunity } from './utils/join_community'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +import { ConversationItem } from '../locators/home'; +import { open_Alice2 } from '../state_builder'; +import { sleepFor } from '../utils'; +import { joinCommunity } from '../utils/join_community'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Join community test', diff --git a/run/test/specs/cta_donate_review.spec.ts b/run/test/specs/cta_donate_review.spec.ts index d848d35e25..6000863d39 100644 --- a/run/test/specs/cta_donate_review.spec.ts +++ b/run/test/specs/cta_donate_review.spec.ts @@ -1,17 +1,17 @@ import test, { TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { TestSteps } from '../../types/allure'; import { bothPlatformsIt } from '../../types/sessionIt'; import { USERNAME } from '../../types/testing'; -import { CloseSettings } from './locators'; -import { CTAButtonPositive } from './locators/global'; -import { ReviewPromptItsGreatButton } from './locators/home'; -import { PathMenuItem, UserSettings } from './locators/settings'; -import { newUser } from './utils/create_account'; -import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from './utils/open_app'; -import { forceStopAndRestart as forceStopAndRestartApp } from './utils/utilities'; -import { verifyPageScreenshot } from './utils/verify_screenshots'; +import { CloseSettings } from '../locators'; +import { CTAButtonPositive } from '../locators/global'; +import { ReviewPromptItsGreatButton } from '../locators/home'; +import { PathMenuItem, UserSettings } from '../locators/settings'; +import { newUser } from '../utils/create_account'; +import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from '../utils/open_app'; +import { forceStopAndRestart as forceStopAndRestartApp } from '../utils/utilities'; +import { verifyPageScreenshot } from '../utils/verify_screenshots'; bothPlatformsIt({ title: 'Donate CTA shows after positive review', @@ -45,9 +45,9 @@ async function donateCTAReview(platform: SupportedPlatformsType, testInfo: TestI }); await test.step(TestSteps.VERIFY.SPECIFIC_MODAL('Donate CTA'), async () => { await device.checkCTAStrings( - englishStrippedStr('donateSessionHelp').toString(), - englishStrippedStr('donateSessionDescription').toString(), - [englishStrippedStr('donate').toString(), englishStrippedStr('maybeLater').toString()] + tStripped('donateSessionHelp'), + tStripped('donateSessionDescription'), + [tStripped('donate'), tStripped('maybeLater')] ); }); // There *is* supposed to be a blur on Android but there is a bug on API 34 emulators preventing it from showing @@ -57,8 +57,8 @@ async function donateCTAReview(platform: SupportedPlatformsType, testInfo: TestI await test.step(TestSteps.VERIFY.SPECIFIC_MODAL('Open URL'), async () => { await device.clickOnElementAll(new CTAButtonPositive(device)); await device.checkModalStrings( - englishStrippedStr('urlOpen').toString(), - englishStrippedStr('urlOpenDescription').withArgs({ url: donateURL }).toString() + tStripped('urlOpen'), + tStripped('urlOpenDescription', { url: donateURL }) ); }); await test.step(TestSteps.SETUP.CLOSE_APP, async () => { diff --git a/run/test/specs/cta_donate_time.spec.ts b/run/test/specs/cta_donate_time.spec.ts index 0fb871d95a..06844e0f0e 100644 --- a/run/test/specs/cta_donate_time.spec.ts +++ b/run/test/specs/cta_donate_time.spec.ts @@ -1,19 +1,19 @@ import test, { TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { TestSteps } from '../../types/allure'; import { iosIt } from '../../types/sessionIt'; import { USERNAME } from '../../types/testing'; -import { CTAButtonPositive } from './locators/global'; -import { PlusButton } from './locators/home'; -import { newUser } from './utils/create_account'; +import { CTAButtonPositive } from '../locators/global'; +import { PlusButton } from '../locators/home'; +import { newUser } from '../utils/create_account'; import { closeApp, IOSTestContext, openAppOnPlatformSingleDevice, SupportedPlatformsType, -} from './utils/open_app'; -import { setIOSFirstInstallDate } from './utils/time_travel'; +} from '../utils/open_app'; +import { setIOSFirstInstallDate } from '../utils/time_travel'; // iOS uses app-level time override (customFirstInstallDateTime capability). // Android would require system-level time manipulation (`adb root` + `toybox date`), which @@ -43,9 +43,9 @@ async function donateCTAShowsSevenDaysAgo(platform: SupportedPlatformsType, test }); await test.step(TestSteps.VERIFY.SPECIFIC_MODAL('Donate CTA'), async () => { await device.checkCTAStrings( - englishStrippedStr('donateSessionHelp').toString(), - englishStrippedStr('donateSessionDescription').toString(), - [englishStrippedStr('donate').toString(), englishStrippedStr('maybeLater').toString()] + tStripped('donateSessionHelp'), + tStripped('donateSessionDescription'), + [tStripped('donate'), tStripped('maybeLater')] ); }); await test.step(TestSteps.SETUP.CLOSE_APP, async () => { diff --git a/run/test/specs/disappear_after_read.spec.ts b/run/test/specs/disappear_after_read.spec.ts index ffaddd951d..1b9773eba3 100644 --- a/run/test/specs/disappear_after_read.spec.ts +++ b/run/test/specs/disappear_after_read.spec.ts @@ -3,11 +3,11 @@ import { test, type TestInfo } from '@playwright/test'; import { TestSteps } from '../../types/allure'; import { bothPlatformsIt } from '../../types/sessionIt'; import { DISAPPEARING_TIMES, DisappearModes } from '../../types/testing'; -import { MessageBody } from './locators/conversation'; -import { open_Alice1_Bob1_friends } from './state_builder'; -import { checkDisappearingControlMessage } from './utils/disappearing_control_messages'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; -import { setDisappearingMessage } from './utils/set_disappearing_messages'; +import { MessageBody } from '../locators/conversation'; +import { open_Alice1_Bob1_friends } from '../state_builder'; +import { checkDisappearingControlMessage } from '../utils/disappearing_control_messages'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; +import { setDisappearingMessage } from '../utils/set_disappearing_messages'; bothPlatformsIt({ title: 'Disappear after read', diff --git a/run/test/specs/disappear_after_send.spec.ts b/run/test/specs/disappear_after_send.spec.ts index b19ffb2027..e1c6b6d702 100644 --- a/run/test/specs/disappear_after_send.spec.ts +++ b/run/test/specs/disappear_after_send.spec.ts @@ -2,11 +2,11 @@ import type { TestInfo } from '@playwright/test'; import { bothPlatformsIt } from '../../types/sessionIt'; import { DisappearActions, DISAPPEARING_TIMES, DisappearModes } from '../../types/testing'; -import { MessageBody } from './locators/conversation'; -import { open_Alice1_Bob1_friends } from './state_builder'; -import { checkDisappearingControlMessage } from './utils/disappearing_control_messages'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; -import { setDisappearingMessage } from './utils/set_disappearing_messages'; +import { MessageBody } from '../locators/conversation'; +import { open_Alice1_Bob1_friends } from '../state_builder'; +import { checkDisappearingControlMessage } from '../utils/disappearing_control_messages'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; +import { setDisappearingMessage } from '../utils/set_disappearing_messages'; bothPlatformsIt({ title: 'Disappear after send', diff --git a/run/test/specs/disappear_after_send_groups.spec.ts b/run/test/specs/disappear_after_send_groups.spec.ts index d46f24beab..0ad50a7e1e 100644 --- a/run/test/specs/disappear_after_send_groups.spec.ts +++ b/run/test/specs/disappear_after_send_groups.spec.ts @@ -1,13 +1,13 @@ import { test, type TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { TestSteps } from '../../types/allure'; import { bothPlatformsIt } from '../../types/sessionIt'; import { DisappearActions, DISAPPEARING_TIMES } from '../../types/testing'; -import { MessageBody } from './locators/conversation'; -import { open_Alice1_Bob1_Charlie1_friends_group } from './state_builder'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; -import { setDisappearingMessage } from './utils/set_disappearing_messages'; +import { MessageBody } from '../locators/conversation'; +import { open_Alice1_Bob1_Charlie1_friends_group } from '../state_builder'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; +import { setDisappearingMessage } from '../utils/set_disappearing_messages'; bothPlatformsIt({ title: 'Disappear after send groups', @@ -45,13 +45,16 @@ async function disappearAfterSendGroups(platform: SupportedPlatformsType, testIn }); await test.step(TestSteps.VERIFY.DISAPPEARING_CONTROL_MESSAGES, async () => { // Get correct control message for You setting disappearing messages - const disappearingMessagesSetYou = englishStrippedStr('disappearingMessagesSetYou') - .withArgs({ time, disappearing_messages_type: controlMode }) - .toString(); + const disappearingMessagesSetYou = tStripped('disappearingMessagesSetYou', { + time, + disappearing_messages_type: controlMode, + }); // Get correct control message for alice setting disappearing messages - const disappearingMessagesSetControl = englishStrippedStr('disappearingMessagesSet') - .withArgs({ name: alice.userName, time, disappearing_messages_type: controlMode }) - .toString(); + const disappearingMessagesSetControl = tStripped('disappearingMessagesSet', { + name: alice.userName, + time, + disappearing_messages_type: controlMode, + }); // Check control message is correct on device 1, 2 and 3 await Promise.all([ alice1.waitForControlMessageToBePresent(disappearingMessagesSetYou), diff --git a/run/test/specs/disappear_after_send_note_to_self.spec.ts b/run/test/specs/disappear_after_send_note_to_self.spec.ts index fb7ed8ad5b..f5d77399d3 100644 --- a/run/test/specs/disappear_after_send_note_to_self.spec.ts +++ b/run/test/specs/disappear_after_send_note_to_self.spec.ts @@ -3,13 +3,13 @@ import { test, type TestInfo } from '@playwright/test'; import { TestSteps } from '../../types/allure'; import { bothPlatformsIt } from '../../types/sessionIt'; import { DisappearActions, DISAPPEARING_TIMES, USERNAME } from '../../types/testing'; -import { MessageBody } from './locators/conversation'; -import { PlusButton } from './locators/home'; -import { EnterAccountID, NewMessageOption, NextButton } from './locators/start_conversation'; -import { sleepFor } from './utils'; -import { newUser } from './utils/create_account'; -import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from './utils/open_app'; -import { setDisappearingMessage } from './utils/set_disappearing_messages'; +import { MessageBody } from '../locators/conversation'; +import { PlusButton } from '../locators/home'; +import { EnterAccountID, NewMessageOption, NextButton } from '../locators/start_conversation'; +import { sleepFor } from '../utils'; +import { newUser } from '../utils/create_account'; +import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from '../utils/open_app'; +import { setDisappearingMessage } from '../utils/set_disappearing_messages'; bothPlatformsIt({ title: 'Disappear after send note to self', diff --git a/run/test/specs/disappear_after_send_off_1o1.spec.ts b/run/test/specs/disappear_after_send_off_1o1.spec.ts index 2c63b24372..fcef4670d0 100644 --- a/run/test/specs/disappear_after_send_off_1o1.spec.ts +++ b/run/test/specs/disappear_after_send_off_1o1.spec.ts @@ -1,21 +1,21 @@ import type { TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { bothPlatformsIt } from '../../types/sessionIt'; import { DisappearActions, DISAPPEARING_TIMES, DisappearModes } from '../../types/testing'; -import { ConversationSettings } from './locators/conversation'; +import { ConversationSettings } from '../locators/conversation'; import { DisableDisappearingMessages, DisappearingMessagesMenuOption, DisappearingMessagesSubtitle, FollowSettingsButton, SetDisappearMessagesButton, -} from './locators/disappearing_messages'; -import { open_Alice2_Bob1_friends } from './state_builder'; -import { sleepFor } from './utils'; -import { checkDisappearingControlMessage } from './utils/disappearing_control_messages'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; -import { setDisappearingMessage } from './utils/set_disappearing_messages'; +} from '../locators/disappearing_messages'; +import { open_Alice2_Bob1_friends } from '../state_builder'; +import { sleepFor } from '../utils'; +import { checkDisappearingControlMessage } from '../utils/disappearing_control_messages'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; +import { setDisappearingMessage } from '../utils/set_disappearing_messages'; bothPlatformsIt({ title: 'Disappear after send off 1:1', @@ -66,13 +66,11 @@ async function disappearAfterSendOff1o1(platform: SupportedPlatformsType, testIn await alice1.navigateBack(); // Check control message for turning off disappearing messages // Check USER A'S CONTROL MESSAGE on device 1 and 3 (linked device) - const disappearingMessagesTurnedOffYou = englishStrippedStr( - 'disappearingMessagesTurnedOffYou' - ).toString(); + const disappearingMessagesTurnedOffYou = tStripped('disappearingMessagesTurnedOffYou'); // Check USER B'S CONTROL MESSAGE - const disappearingMessagesTurnedOff = englishStrippedStr('disappearingMessagesTurnedOff') - .withArgs({ name: alice.userName }) - .toString(); + const disappearingMessagesTurnedOff = tStripped('disappearingMessagesTurnedOff', { + name: alice.userName, + }); await Promise.all([ alice1.waitForControlMessageToBePresent(disappearingMessagesTurnedOffYou), bob1.waitForControlMessageToBePresent(disappearingMessagesTurnedOff), @@ -82,8 +80,8 @@ async function disappearAfterSendOff1o1(platform: SupportedPlatformsType, testIn await bob1.clickOnElementAll(new FollowSettingsButton(bob1)); await sleepFor(500); await bob1.checkModalStrings( - englishStrippedStr('disappearingMessagesFollowSetting').toString(), - englishStrippedStr('disappearingMessagesFollowSettingOff').toString() + tStripped('disappearingMessagesFollowSetting'), + tStripped('disappearingMessagesFollowSettingOff') ); await bob1.clickOnElementAll({ strategy: 'accessibility id', selector: 'Confirm' }); // Check conversation subtitle? diff --git a/run/test/specs/disappearing_call.spec.ts b/run/test/specs/disappearing_call.spec.ts index b412e274c2..e7c16ac421 100644 --- a/run/test/specs/disappearing_call.spec.ts +++ b/run/test/specs/disappearing_call.spec.ts @@ -1,15 +1,15 @@ import { test, type TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { TestSteps } from '../../types/allure'; import { bothPlatformsItSeparate } from '../../types/sessionIt'; import { DISAPPEARING_TIMES } from '../../types/testing'; -import { CloseSettings } from './locators'; -import { CallButton, NotificationsModalButton, NotificationSwitch } from './locators/conversation'; -import { open_Alice1_Bob1_friends } from './state_builder'; -import { sleepFor } from './utils'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; -import { setDisappearingMessage } from './utils/set_disappearing_messages'; +import { CloseSettings } from '../locators'; +import { CallButton, NotificationsModalButton, NotificationSwitch } from '../locators/conversation'; +import { open_Alice1_Bob1_friends } from '../state_builder'; +import { sleepFor } from '../utils'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; +import { setDisappearingMessage } from '../utils/set_disappearing_messages'; bothPlatformsItSeparate({ title: 'Disappearing call message 1:1', @@ -91,12 +91,8 @@ async function disappearingCallMessage1o1Ios(platform: SupportedPlatformsType, t await bob1.clickOnElementAll(new CloseSettings(bob1)); })(), ]); - const callsYouCalled = englishStrippedStr('callsYouCalled') - .withArgs({ name: bob.userName }) - .toString(); - const callsMissedCallFrom = englishStrippedStr('callsMissedCallFrom') - .withArgs({ name: alice.userName }) - .toString(); + const callsYouCalled = tStripped('callsYouCalled', { name: bob.userName }); + const callsMissedCallFrom = tStripped('callsMissedCallFrom', { name: alice.userName }); await Promise.all([ alice1.hasElementDisappeared({ strategy: 'accessibility id', diff --git a/run/test/specs/disappearing_community_invite.spec.ts b/run/test/specs/disappearing_community_invite.spec.ts index 8bf16c4802..e604f60c34 100644 --- a/run/test/specs/disappearing_community_invite.spec.ts +++ b/run/test/specs/disappearing_community_invite.spec.ts @@ -2,20 +2,20 @@ import type { TestInfo } from '@playwright/test'; import { bothPlatformsIt } from '../../types/sessionIt'; import { DISAPPEARING_TIMES } from '../../types/testing'; -import { testCommunityLink, testCommunityName } from './../../constants/community'; -import { InviteContactsMenuItem } from './locators'; +import { InviteContactsMenuItem } from '../locators'; import { CommunityInvitation, CommunityInviteConfirmButton, ConversationSettings, -} from './locators/conversation'; -import { GroupMember } from './locators/groups'; -import { ConversationItem } from './locators/home'; -import { open_Alice1_Bob1_friends } from './state_builder'; -import { sleepFor } from './utils'; -import { joinCommunity } from './utils/join_community'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; -import { setDisappearingMessage } from './utils/set_disappearing_messages'; +} from '../locators/conversation'; +import { GroupMember } from '../locators/groups'; +import { ConversationItem } from '../locators/home'; +import { open_Alice1_Bob1_friends } from '../state_builder'; +import { sleepFor } from '../utils'; +import { joinCommunity } from '../utils/join_community'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; +import { setDisappearingMessage } from '../utils/set_disappearing_messages'; +import { testCommunityLink, testCommunityName } from './../../constants/community'; bothPlatformsIt({ title: 'Disappearing community invite message 1:1', diff --git a/run/test/specs/disappearing_gif.spec.ts b/run/test/specs/disappearing_gif.spec.ts index 220924bda9..812e47773e 100644 --- a/run/test/specs/disappearing_gif.spec.ts +++ b/run/test/specs/disappearing_gif.spec.ts @@ -2,10 +2,10 @@ import type { TestInfo } from '@playwright/test'; import { bothPlatformsIt } from '../../types/sessionIt'; import { DISAPPEARING_TIMES, USERNAME } from '../../types/testing'; -import { MediaMessage } from './locators/conversation'; -import { open_Alice1_Bob1_friends } from './state_builder'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; -import { setDisappearingMessage } from './utils/set_disappearing_messages'; +import { MediaMessage } from '../locators/conversation'; +import { open_Alice1_Bob1_friends } from '../state_builder'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; +import { setDisappearingMessage } from '../utils/set_disappearing_messages'; bothPlatformsIt({ title: 'Disappearing GIF message 1:1', diff --git a/run/test/specs/disappearing_image.spec.ts b/run/test/specs/disappearing_image.spec.ts index e4d98645c5..afa7d4313e 100644 --- a/run/test/specs/disappearing_image.spec.ts +++ b/run/test/specs/disappearing_image.spec.ts @@ -2,10 +2,10 @@ import type { TestInfo } from '@playwright/test'; import { bothPlatformsIt } from '../../types/sessionIt'; import { DISAPPEARING_TIMES } from '../../types/testing'; -import { MediaMessage, MessageBody } from './locators/conversation'; -import { open_Alice1_Bob1_friends } from './state_builder'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; -import { setDisappearingMessage } from './utils/set_disappearing_messages'; +import { MediaMessage, MessageBody } from '../locators/conversation'; +import { open_Alice1_Bob1_friends } from '../state_builder'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; +import { setDisappearingMessage } from '../utils/set_disappearing_messages'; bothPlatformsIt({ title: 'Disappearing image message 1:1', diff --git a/run/test/specs/disappearing_link.spec.ts b/run/test/specs/disappearing_link.spec.ts index 596b0ef318..adf01dc066 100644 --- a/run/test/specs/disappearing_link.spec.ts +++ b/run/test/specs/disappearing_link.spec.ts @@ -1,22 +1,22 @@ import { test, type TestInfo } from '@playwright/test'; import { testLink } from '../../constants'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { TestSteps } from '../../types/allure'; import { bothPlatformsItSeparate } from '../../types/sessionIt'; import { DISAPPEARING_TIMES } from '../../types/testing'; -import { LinkPreview, LinkPreviewMessage } from './locators'; +import { LinkPreview, LinkPreviewMessage } from '../locators'; import { MessageBody, MessageInput, OutgoingMessageStatusSent, SendButton, -} from './locators/conversation'; -import { EnableLinkPreviewsModalButton } from './locators/global'; -import { open_Alice1_Bob1_friends } from './state_builder'; -import { sleepFor } from './utils'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; -import { setDisappearingMessage } from './utils/set_disappearing_messages'; +} from '../locators/conversation'; +import { EnableLinkPreviewsModalButton } from '../locators/global'; +import { open_Alice1_Bob1_friends } from '../state_builder'; +import { sleepFor } from '../utils'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; +import { setDisappearingMessage } from '../utils/set_disappearing_messages'; bothPlatformsItSeparate({ title: 'Disappearing link message 1:1', @@ -58,8 +58,8 @@ async function disappearingLinkMessage1o1Ios(platform: SupportedPlatformsType, t // Accept dialog for link preview await test.step(TestSteps.VERIFY.GENERIC_MODAL, async () => { await alice1.checkModalStrings( - englishStrippedStr('linkPreviewsEnable').toString(), - englishStrippedStr('linkPreviewsFirstDescription').toString() + tStripped('linkPreviewsEnable'), + tStripped('linkPreviewsFirstDescription') ); }); await alice1.clickOnElementAll(new EnableLinkPreviewsModalButton(alice1)); @@ -112,8 +112,8 @@ async function disappearingLinkMessage1o1Android( // Accept dialog for link preview await test.step(TestSteps.VERIFY.GENERIC_MODAL, async () => { await alice1.checkModalStrings( - englishStrippedStr('linkPreviewsEnable').toString(), - englishStrippedStr('linkPreviewsFirstDescription').toString() + tStripped('linkPreviewsEnable'), + tStripped('linkPreviewsFirstDescription') ); }); await alice1.clickOnElementAll(new EnableLinkPreviewsModalButton(alice1)); diff --git a/run/test/specs/disappearing_video.spec.ts b/run/test/specs/disappearing_video.spec.ts index 67df3bb6fe..9c81c6d418 100644 --- a/run/test/specs/disappearing_video.spec.ts +++ b/run/test/specs/disappearing_video.spec.ts @@ -2,10 +2,10 @@ import type { TestInfo } from '@playwright/test'; import { bothPlatformsIt } from '../../types/sessionIt'; import { DISAPPEARING_TIMES } from '../../types/testing'; -import { MediaMessage, MessageBody } from './locators/conversation'; -import { open_Alice1_Bob1_friends } from './state_builder'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; -import { setDisappearingMessage } from './utils/set_disappearing_messages'; +import { MediaMessage, MessageBody } from '../locators/conversation'; +import { open_Alice1_Bob1_friends } from '../state_builder'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; +import { setDisappearingMessage } from '../utils/set_disappearing_messages'; bothPlatformsIt({ title: 'Disappearing video message 1:1', diff --git a/run/test/specs/disappearing_voice.spec.ts b/run/test/specs/disappearing_voice.spec.ts index 54713a7133..ba6718a829 100644 --- a/run/test/specs/disappearing_voice.spec.ts +++ b/run/test/specs/disappearing_voice.spec.ts @@ -2,10 +2,10 @@ import type { TestInfo } from '@playwright/test'; import { bothPlatformsIt } from '../../types/sessionIt'; import { DISAPPEARING_TIMES } from '../../types/testing'; -import { VoiceMessage } from './locators/conversation'; -import { open_Alice1_Bob1_friends } from './state_builder'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; -import { setDisappearingMessage } from './utils/set_disappearing_messages'; +import { VoiceMessage } from '../locators/conversation'; +import { open_Alice1_Bob1_friends } from '../state_builder'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; +import { setDisappearingMessage } from '../utils/set_disappearing_messages'; bothPlatformsIt({ title: 'Disappearing voice message 1:1', diff --git a/run/test/specs/donate.spec.ts b/run/test/specs/donate.spec.ts index 5a494af7bf..31bda2eea5 100644 --- a/run/test/specs/donate.spec.ts +++ b/run/test/specs/donate.spec.ts @@ -1,15 +1,15 @@ import type { TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { bothPlatformsIt } from '../../types/sessionIt'; import { USERNAME } from '../../types/testing'; -import { SafariAddressBar, URLInputField } from './locators/browsers'; -import { OpenLinkButton } from './locators/network_page'; -import { DonationsMenuItem, UserSettings } from './locators/settings'; -import { newUser } from './utils/create_account'; -import { handleChromeFirstTimeOpen } from './utils/handle_first_open'; -import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from './utils/open_app'; -import { assertUrlIsReachable, ensureHttpsURL } from './utils/utilities'; +import { SafariAddressBar, URLInputField } from '../locators/browsers'; +import { OpenLinkButton } from '../locators/network_page'; +import { DonationsMenuItem, UserSettings } from '../locators/settings'; +import { newUser } from '../utils/create_account'; +import { handleChromeFirstTimeOpen } from '../utils/handle_first_open'; +import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from '../utils/open_app'; +import { assertUrlIsReachable, ensureHttpsURL } from '../utils/utilities'; bothPlatformsIt({ title: 'Donate Settings menu item', @@ -30,8 +30,8 @@ async function donateLinkout(platform: SupportedPlatformsType, testInfo: TestInf await device.clickOnElementAll(new UserSettings(device)); await device.clickOnElementAll(new DonationsMenuItem(device)); await device.checkModalStrings( - englishStrippedStr('urlOpen').toString(), - englishStrippedStr('urlOpenDescription').withArgs({ url: linkURL }).toString() + tStripped('urlOpen'), + tStripped('urlOpenDescription', { url: linkURL }) ); await device.clickOnElementAll(new OpenLinkButton(device)); if (platform === 'ios') { diff --git a/run/test/specs/group_disappearing_messages_gif.spec.ts b/run/test/specs/group_disappearing_messages_gif.spec.ts index 7d396e0fef..9c9c70eef0 100644 --- a/run/test/specs/group_disappearing_messages_gif.spec.ts +++ b/run/test/specs/group_disappearing_messages_gif.spec.ts @@ -2,10 +2,10 @@ import type { TestInfo } from '@playwright/test'; import { bothPlatformsIt } from '../../types/sessionIt'; import { DISAPPEARING_TIMES } from '../../types/testing'; -import { MediaMessage } from './locators/conversation'; -import { open_Alice1_Bob1_Charlie1_friends_group } from './state_builder'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; -import { setDisappearingMessage } from './utils/set_disappearing_messages'; +import { MediaMessage } from '../locators/conversation'; +import { open_Alice1_Bob1_Charlie1_friends_group } from '../state_builder'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; +import { setDisappearingMessage } from '../utils/set_disappearing_messages'; bothPlatformsIt({ title: 'Disappearing GIF to group', diff --git a/run/test/specs/group_disappearing_messages_image.spec.ts b/run/test/specs/group_disappearing_messages_image.spec.ts index c8fe127862..47ffbddf62 100644 --- a/run/test/specs/group_disappearing_messages_image.spec.ts +++ b/run/test/specs/group_disappearing_messages_image.spec.ts @@ -2,10 +2,10 @@ import type { TestInfo } from '@playwright/test'; import { bothPlatformsIt } from '../../types/sessionIt'; import { DISAPPEARING_TIMES } from '../../types/testing'; -import { MediaMessage, MessageBody } from './locators/conversation'; -import { open_Alice1_Bob1_Charlie1_friends_group } from './state_builder'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; -import { setDisappearingMessage } from './utils/set_disappearing_messages'; +import { MediaMessage, MessageBody } from '../locators/conversation'; +import { open_Alice1_Bob1_Charlie1_friends_group } from '../state_builder'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; +import { setDisappearingMessage } from '../utils/set_disappearing_messages'; bothPlatformsIt({ title: 'Disappearing image message to group', diff --git a/run/test/specs/group_disappearing_messages_link.spec.ts b/run/test/specs/group_disappearing_messages_link.spec.ts index f7ab42b0cc..226834583d 100644 --- a/run/test/specs/group_disappearing_messages_link.spec.ts +++ b/run/test/specs/group_disappearing_messages_link.spec.ts @@ -1,22 +1,22 @@ import { test, type TestInfo } from '@playwright/test'; import { testLink } from '../../constants'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { TestSteps } from '../../types/allure'; import { bothPlatformsIt } from '../../types/sessionIt'; import { DISAPPEARING_TIMES } from '../../types/testing'; -import { LinkPreviewMessage } from './locators'; +import { LinkPreviewMessage } from '../locators'; import { MessageBody, MessageInput, OutgoingMessageStatusSent, SendButton, -} from './locators/conversation'; -import { EnableLinkPreviewsModalButton } from './locators/global'; -import { open_Alice1_Bob1_Charlie1_friends_group } from './state_builder'; -import { sleepFor } from './utils'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; -import { setDisappearingMessage } from './utils/set_disappearing_messages'; +} from '../locators/conversation'; +import { EnableLinkPreviewsModalButton } from '../locators/global'; +import { open_Alice1_Bob1_Charlie1_friends_group } from '../state_builder'; +import { sleepFor } from '../utils'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; +import { setDisappearingMessage } from '../utils/set_disappearing_messages'; bothPlatformsIt({ title: 'Disappearing link to group', @@ -54,8 +54,8 @@ async function disappearingLinkMessageGroup(platform: SupportedPlatformsType, te // Enable link preview modal appears as soon as link is typed on android but on iOS it appears after await test.step(TestSteps.VERIFY.GENERIC_MODAL, async () => { await alice1.checkModalStrings( - englishStrippedStr('linkPreviewsEnable').toString(), - englishStrippedStr('linkPreviewsFirstDescription').toString() + tStripped('linkPreviewsEnable'), + tStripped('linkPreviewsFirstDescription') ); }); // Accept link preview modal diff --git a/run/test/specs/group_disappearing_messages_members.spec.ts b/run/test/specs/group_disappearing_messages_members.spec.ts index bcbf8e6b5d..33e728eabc 100644 --- a/run/test/specs/group_disappearing_messages_members.spec.ts +++ b/run/test/specs/group_disappearing_messages_members.spec.ts @@ -2,14 +2,14 @@ import type { TestInfo } from '@playwright/test'; import { bothPlatformsIt } from '../../types/sessionIt'; import { DISAPPEARING_TIMES } from '../../types/testing'; -import { ConversationSettings } from './locators/conversation'; +import { ConversationSettings } from '../locators/conversation'; import { DisappearingMessageRadial, DisappearingMessagesMenuOption, SetDisappearMessagesButton, -} from './locators/disappearing_messages'; -import { open_Alice1_Bob1_Charlie1_friends_group } from './state_builder'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +} from '../locators/disappearing_messages'; +import { open_Alice1_Bob1_Charlie1_friends_group } from '../state_builder'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Group member disappearing messages', diff --git a/run/test/specs/group_disappearing_messages_video.spec.ts b/run/test/specs/group_disappearing_messages_video.spec.ts index 1ae36d83eb..20d3d048c1 100644 --- a/run/test/specs/group_disappearing_messages_video.spec.ts +++ b/run/test/specs/group_disappearing_messages_video.spec.ts @@ -2,10 +2,10 @@ import type { TestInfo } from '@playwright/test'; import { bothPlatformsIt } from '../../types/sessionIt'; import { DISAPPEARING_TIMES } from '../../types/testing'; -import { MediaMessage, MessageBody } from './locators/conversation'; -import { open_Alice1_Bob1_Charlie1_friends_group } from './state_builder'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; -import { setDisappearingMessage } from './utils/set_disappearing_messages'; +import { MediaMessage, MessageBody } from '../locators/conversation'; +import { open_Alice1_Bob1_Charlie1_friends_group } from '../state_builder'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; +import { setDisappearingMessage } from '../utils/set_disappearing_messages'; bothPlatformsIt({ title: 'Disappearing video to group', diff --git a/run/test/specs/group_disappearing_messages_voice.spec.ts b/run/test/specs/group_disappearing_messages_voice.spec.ts index 83c1bf6a02..25862d0a7c 100644 --- a/run/test/specs/group_disappearing_messages_voice.spec.ts +++ b/run/test/specs/group_disappearing_messages_voice.spec.ts @@ -2,9 +2,9 @@ import type { TestInfo } from '@playwright/test'; import { bothPlatformsIt } from '../../types/sessionIt'; import { DISAPPEARING_TIMES, GROUPNAME } from '../../types/testing'; -import { open_Alice1_Bob1_Charlie1_friends_group } from './state_builder'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; -import { setDisappearingMessage } from './utils/set_disappearing_messages'; +import { open_Alice1_Bob1_Charlie1_friends_group } from '../state_builder'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; +import { setDisappearingMessage } from '../utils/set_disappearing_messages'; bothPlatformsIt({ title: 'Disappearing voice message to group', diff --git a/run/test/specs/group_message_delete.spec.ts b/run/test/specs/group_message_delete.spec.ts index a750e1cd50..4cc72479fb 100644 --- a/run/test/specs/group_message_delete.spec.ts +++ b/run/test/specs/group_message_delete.spec.ts @@ -1,11 +1,11 @@ import type { TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { bothPlatformsIt } from '../../types/sessionIt'; -import { DeleteMessageConfirmationModal, DeleteMessageLocally } from './locators'; -import { DeletedMessage, MessageBody } from './locators/conversation'; -import { open_Alice1_Bob1_Charlie1_friends_group } from './state_builder'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +import { DeleteMessageConfirmationModal, DeleteMessageLocally } from '../locators'; +import { DeletedMessage, MessageBody } from '../locators/conversation'; +import { open_Alice1_Bob1_Charlie1_friends_group } from '../state_builder'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Delete message locally in group', @@ -43,8 +43,8 @@ async function deleteMessageGroup(platform: SupportedPlatformsType, testInfo: Te await alice1.clickOnByAccessibilityID('Delete message'); // Check modal is correct await alice1.checkModalStrings( - englishStrippedStr('deleteMessage').withArgs({ count: 1 }).toString(), - englishStrippedStr('deleteMessageConfirm').withArgs({ count: 1 }).toString() + tStripped('deleteMessage', { count: 1 }), + tStripped('deleteMessageConfirm', { count: 1 }) ); // Select 'Delete for me' await alice1.clickOnElementAll(new DeleteMessageLocally(alice1)); diff --git a/run/test/specs/group_message_document.spec.ts b/run/test/specs/group_message_document.spec.ts index deeb17d4f1..b2824ffad6 100644 --- a/run/test/specs/group_message_document.spec.ts +++ b/run/test/specs/group_message_document.spec.ts @@ -1,10 +1,10 @@ import type { TestInfo } from '@playwright/test'; import { bothPlatformsItSeparate } from '../../types/sessionIt'; -import { DocumentMessage, MessageBody } from './locators/conversation'; -import { open_Alice1_Bob1_Charlie1_friends_group } from './state_builder'; -import { sleepFor } from './utils'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +import { DocumentMessage, MessageBody } from '../locators/conversation'; +import { open_Alice1_Bob1_Charlie1_friends_group } from '../state_builder'; +import { sleepFor } from '../utils'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsItSeparate({ title: 'Send document to group', diff --git a/run/test/specs/group_message_gif.spec.ts b/run/test/specs/group_message_gif.spec.ts index fffd0d6031..075edb9304 100644 --- a/run/test/specs/group_message_gif.spec.ts +++ b/run/test/specs/group_message_gif.spec.ts @@ -1,10 +1,10 @@ import type { TestInfo } from '@playwright/test'; import { bothPlatformsItSeparate } from '../../types/sessionIt'; -import { MediaMessage, MessageBody } from './locators/conversation'; -import { open_Alice1_Bob1_Charlie1_friends_group } from './state_builder'; -import { sleepFor } from './utils'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +import { MediaMessage, MessageBody } from '../locators/conversation'; +import { open_Alice1_Bob1_Charlie1_friends_group } from '../state_builder'; +import { sleepFor } from '../utils'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsItSeparate({ title: 'Send GIF to group', diff --git a/run/test/specs/group_message_image.spec.ts b/run/test/specs/group_message_image.spec.ts index adfb3ba513..30ad7ae569 100644 --- a/run/test/specs/group_message_image.spec.ts +++ b/run/test/specs/group_message_image.spec.ts @@ -1,10 +1,10 @@ import type { TestInfo } from '@playwright/test'; import { bothPlatformsItSeparate } from '../../types/sessionIt'; -import { MediaMessage, MessageBody, OutgoingMessageStatusSent } from './locators/conversation'; -import { open_Alice1_Bob1_Charlie1_friends_group } from './state_builder'; -import { sleepFor } from './utils'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +import { MediaMessage, MessageBody, OutgoingMessageStatusSent } from '../locators/conversation'; +import { open_Alice1_Bob1_Charlie1_friends_group } from '../state_builder'; +import { sleepFor } from '../utils'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsItSeparate({ title: 'Send image to group', diff --git a/run/test/specs/group_message_link_preview.spec.ts b/run/test/specs/group_message_link_preview.spec.ts index 1ccc5c0ee2..57495c4843 100644 --- a/run/test/specs/group_message_link_preview.spec.ts +++ b/run/test/specs/group_message_link_preview.spec.ts @@ -1,19 +1,19 @@ import type { TestInfo } from '@playwright/test'; import { testLink } from '../../constants'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { bothPlatformsItSeparate } from '../../types/sessionIt'; -import { LinkPreview, LinkPreviewMessage } from './locators'; +import { LinkPreview, LinkPreviewMessage } from '../locators'; import { MessageBody, MessageInput, OutgoingMessageStatusSent, SendButton, -} from './locators/conversation'; -import { EnableLinkPreviewsModalButton } from './locators/global'; -import { open_Alice1_Bob1_Charlie1_friends_group } from './state_builder'; -import { sleepFor } from './utils'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +} from '../locators/conversation'; +import { EnableLinkPreviewsModalButton } from '../locators/global'; +import { open_Alice1_Bob1_Charlie1_friends_group } from '../state_builder'; +import { sleepFor } from '../utils'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsItSeparate({ title: 'Send link to group', @@ -50,8 +50,8 @@ async function sendLinkGroupiOS(platform: SupportedPlatformsType, testInfo: Test await alice1.inputText(testLink, new MessageInput(alice1)); // Accept dialog for link preview await alice1.checkModalStrings( - englishStrippedStr('linkPreviewsEnable').toString(), - englishStrippedStr('linkPreviewsFirstDescription').toString() + tStripped('linkPreviewsEnable'), + tStripped('linkPreviewsFirstDescription') ); await alice1.clickOnElementAll(new EnableLinkPreviewsModalButton(alice1)); // No preview on first send @@ -98,8 +98,8 @@ async function sendLinkGroupAndroid(platform: SupportedPlatformsType, testInfo: await alice1.inputText(testLink, new MessageInput(alice1)); // Accept dialog for link preview await alice1.checkModalStrings( - englishStrippedStr('linkPreviewsEnable').toString(), - englishStrippedStr('linkPreviewsFirstDescription').toString() + tStripped('linkPreviewsEnable'), + tStripped('linkPreviewsFirstDescription') ); await alice1.clickOnElementAll(new EnableLinkPreviewsModalButton(alice1)); //wait for preview to generate diff --git a/run/test/specs/group_message_long_text.spec.ts b/run/test/specs/group_message_long_text.spec.ts index 3f4b103da8..e286eda184 100644 --- a/run/test/specs/group_message_long_text.spec.ts +++ b/run/test/specs/group_message_long_text.spec.ts @@ -2,9 +2,9 @@ import type { TestInfo } from '@playwright/test'; import { longText } from '../../constants'; import { bothPlatformsIt } from '../../types/sessionIt'; -import { MessageBody } from './locators/conversation'; -import { open_Alice1_Bob1_Charlie1_friends_group } from './state_builder'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +import { MessageBody } from '../locators/conversation'; +import { open_Alice1_Bob1_Charlie1_friends_group } from '../state_builder'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Send long message to group', diff --git a/run/test/specs/group_message_unsend.spec.ts b/run/test/specs/group_message_unsend.spec.ts index cb01db8c59..426887bca3 100644 --- a/run/test/specs/group_message_unsend.spec.ts +++ b/run/test/specs/group_message_unsend.spec.ts @@ -1,11 +1,11 @@ import type { TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { bothPlatformsIt } from '../../types/sessionIt'; -import { DeleteMessageConfirmationModal, DeleteMessageForEveryone } from './locators'; -import { DeletedMessage, MessageBody } from './locators/conversation'; -import { open_Alice1_Bob1_Charlie1_friends_group } from './state_builder'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +import { DeleteMessageConfirmationModal, DeleteMessageForEveryone } from '../locators'; +import { DeletedMessage, MessageBody } from '../locators/conversation'; +import { open_Alice1_Bob1_Charlie1_friends_group } from '../state_builder'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Delete message for all in group', @@ -44,8 +44,8 @@ async function unsendMessageGroup(platform: SupportedPlatformsType, testInfo: Te await alice1.clickOnByAccessibilityID('Delete message'); // Check modal is correct await alice1.checkModalStrings( - englishStrippedStr('deleteMessage').withArgs({ count: 1 }).toString(), - englishStrippedStr('deleteMessageConfirm').withArgs({ count: 1 }).toString() + tStripped('deleteMessage', { count: 1 }), + tStripped('deleteMessageConfirm', { count: 1 }) ); // Select 'Delete for me' await alice1.clickOnElementAll(new DeleteMessageForEveryone(alice1)); diff --git a/run/test/specs/group_message_video.spec.ts b/run/test/specs/group_message_video.spec.ts index a284d39db4..eaa5641ee6 100644 --- a/run/test/specs/group_message_video.spec.ts +++ b/run/test/specs/group_message_video.spec.ts @@ -1,10 +1,10 @@ import type { TestInfo } from '@playwright/test'; import { bothPlatformsItSeparate } from '../../types/sessionIt'; -import { MediaMessage, MessageBody } from './locators/conversation'; -import { open_Alice1_Bob1_Charlie1_friends_group } from './state_builder'; -import { sleepFor } from './utils'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +import { MediaMessage, MessageBody } from '../locators/conversation'; +import { open_Alice1_Bob1_Charlie1_friends_group } from '../state_builder'; +import { sleepFor } from '../utils'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsItSeparate({ title: 'Send video to group', diff --git a/run/test/specs/group_message_voice.spec.ts b/run/test/specs/group_message_voice.spec.ts index ad66309fcb..028cd5ffdc 100644 --- a/run/test/specs/group_message_voice.spec.ts +++ b/run/test/specs/group_message_voice.spec.ts @@ -1,10 +1,10 @@ import type { TestInfo } from '@playwright/test'; import { bothPlatformsIt } from '../../types/sessionIt'; -import { MessageBody, VoiceMessage } from './locators/conversation'; -import { open_Alice1_Bob1_Charlie1_friends_group } from './state_builder'; -import { sleepFor } from './utils'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +import { MessageBody, VoiceMessage } from '../locators/conversation'; +import { open_Alice1_Bob1_Charlie1_friends_group } from '../state_builder'; +import { sleepFor } from '../utils'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Send voice message to group', diff --git a/run/test/specs/group_reaction.spec.ts b/run/test/specs/group_reaction.spec.ts index 1c23df6643..38e5d47b44 100644 --- a/run/test/specs/group_reaction.spec.ts +++ b/run/test/specs/group_reaction.spec.ts @@ -8,9 +8,9 @@ import { EmojiReactsPill, FirstEmojiReact, MessageBody, -} from './locators/conversation'; -import { open_Alice1_Bob1_Charlie1_friends_group } from './state_builder'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +} from '../locators/conversation'; +import { open_Alice1_Bob1_Charlie1_friends_group } from '../state_builder'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Send emoji react groups', diff --git a/run/test/specs/group_tests_add_contact.spec.ts b/run/test/specs/group_tests_add_contact.spec.ts index ce4cecae84..17d8ca6fec 100644 --- a/run/test/specs/group_tests_add_contact.spec.ts +++ b/run/test/specs/group_tests_add_contact.spec.ts @@ -1,18 +1,18 @@ import type { TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { bothPlatformsIt } from '../../types/sessionIt'; import { USERNAME } from '../../types/testing'; -import { InviteContactsButton, InviteContactsMenuItem } from './locators'; -import { ConversationSettings } from './locators/conversation'; -import { Contact } from './locators/global'; -import { InviteContactConfirm, ManageMembersMenuItem } from './locators/groups'; -import { ConversationItem } from './locators/home'; -import { open_Alice1_Bob1_Charlie1_Unknown1 } from './state_builder'; -import { sleepFor } from './utils'; -import { newUser } from './utils/create_account'; -import { newContact } from './utils/create_contact'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +import { InviteContactsButton, InviteContactsMenuItem } from '../locators'; +import { ConversationSettings } from '../locators/conversation'; +import { Contact } from '../locators/global'; +import { InviteContactConfirm, ManageMembersMenuItem } from '../locators/groups'; +import { ConversationItem } from '../locators/home'; +import { open_Alice1_Bob1_Charlie1_Unknown1 } from '../state_builder'; +import { sleepFor } from '../utils'; +import { newUser } from '../utils/create_account'; +import { newContact } from '../utils/create_contact'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Add contact to group', @@ -65,7 +65,7 @@ async function addContactToGroup(platform: SupportedPlatformsType, testInfo: Tes await Promise.all( [alice1, bob1, charlie1].map(device => device.waitForControlMessageToBePresent( - englishStrippedStr('groupMemberNew').withArgs({ name: USERNAME.DRACULA }).toString() + tStripped('groupMemberNew', { name: USERNAME.DRACULA }) ) ) ); @@ -74,6 +74,6 @@ async function addContactToGroup(platform: SupportedPlatformsType, testInfo: Tes // Leave Message Requests screen (Android) await unknown1.onAndroid().navigateBack(); await unknown1.clickOnElementAll(new ConversationItem(unknown1, group.groupName)); // Check for control message on device 4 - await unknown1.waitForControlMessageToBePresent(englishStrippedStr('groupInviteYou').toString()); + await unknown1.waitForControlMessageToBePresent(tStripped('groupInviteYou')); await closeApp(alice1, bob1, charlie1, unknown1); } diff --git a/run/test/specs/group_tests_change_group_description.spec.ts b/run/test/specs/group_tests_change_group_description.spec.ts index 2678ef7781..1a94481c04 100644 --- a/run/test/specs/group_tests_change_group_description.spec.ts +++ b/run/test/specs/group_tests_change_group_description.spec.ts @@ -2,21 +2,21 @@ import type { TestInfo } from '@playwright/test'; import { test } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { TestSteps } from '../../types/allure'; import { bothPlatformsItSeparate } from '../../types/sessionIt'; import { AccessibilityId } from '../../types/testing'; -import { ConversationSettings } from './locators/conversation'; +import { ConversationSettings } from '../locators/conversation'; import { EditGroupDescriptionInput, GroupDescription, SaveGroupNameChangeButton, UpdateGroupInformation, -} from './locators/groups'; -import { ErrorMessage } from './locators/onboarding'; -import { open_Alice1_Bob1_Charlie1_friends_group } from './state_builder'; -import { sleepFor } from './utils'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +} from '../locators/groups'; +import { ErrorMessage } from '../locators/onboarding'; +import { open_Alice1_Bob1_Charlie1_friends_group } from '../state_builder'; +import { sleepFor } from '../utils'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsItSeparate({ title: 'Change group description', @@ -51,9 +51,7 @@ if (longGroupDescription.length <= 200) { const trimmedGroupDescription = longGroupDescription.slice(0, 200); // the expected error is 'Please enter a shorter group description' which is represented by the following localized string -const expectedError = englishStrippedStr( - 'updateGroupInformationEnterShorterDescription' -).toString(); +const expectedError = tStripped('updateGroupInformationEnterShorterDescription'); async function changeGroupDescriptionIOS(platform: SupportedPlatformsType, testInfo: TestInfo) { const { diff --git a/run/test/specs/group_tests_change_group_name.spec.ts b/run/test/specs/group_tests_change_group_name.spec.ts index 52d3d02c72..6a112f3691 100644 --- a/run/test/specs/group_tests_change_group_name.spec.ts +++ b/run/test/specs/group_tests_change_group_name.spec.ts @@ -1,16 +1,16 @@ import type { TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { bothPlatformsItSeparate } from '../../types/sessionIt'; -import { ConversationSettings } from './locators/conversation'; +import { ConversationSettings } from '../locators/conversation'; import { EditGroupNameInput, SaveGroupNameChangeButton, UpdateGroupInformation, -} from './locators/groups'; -import { open_Alice1_Bob1_Charlie1_friends_group } from './state_builder'; -import { sleepFor } from './utils'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +} from '../locators/groups'; +import { open_Alice1_Bob1_Charlie1_friends_group } from '../state_builder'; +import { sleepFor } from '../utils'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsItSeparate({ title: 'Change group name', @@ -48,8 +48,8 @@ async function changeGroupNameIos(platform: SupportedPlatformsType, testInfo: Te // Click on current group name await alice1.clickOnElementAll(new UpdateGroupInformation(alice1, testGroupName)); await alice1.checkModalStrings( - englishStrippedStr(`updateGroupInformation`).toString(), - englishStrippedStr(`updateGroupInformationDescription`).toString() + tStripped(`updateGroupInformation`), + tStripped(`updateGroupInformationDescription`) ); await alice1.deleteText(new EditGroupNameInput(alice1)); await alice1.inputText(' ', new EditGroupNameInput(alice1)); @@ -72,7 +72,7 @@ async function changeGroupNameIos(platform: SupportedPlatformsType, testInfo: Te await alice1.clickOnElementAll(new SaveGroupNameChangeButton(alice1)); await alice1.navigateBack(); await alice1.waitForControlMessageToBePresent( - englishStrippedStr('groupNameNew').withArgs({ group_name: newGroupName }).toString() + tStripped('groupNameNew', { group_name: newGroupName }) ); await closeApp(alice1, bob1, charlie1); } @@ -102,7 +102,7 @@ async function changeGroupNameAndroid(platform: SupportedPlatformsType, testInfo await alice1.navigateBack(); // Check control message for changed name await alice1.waitForControlMessageToBePresent( - englishStrippedStr('groupNameNew').withArgs({ group_name: newGroupName }).toString() + tStripped('groupNameNew', { group_name: newGroupName }) ); await closeApp(alice1, bob1, charlie1); } diff --git a/run/test/specs/group_tests_create_group.spec.ts b/run/test/specs/group_tests_create_group.spec.ts index 440f797cb7..de32d5af82 100644 --- a/run/test/specs/group_tests_create_group.spec.ts +++ b/run/test/specs/group_tests_create_group.spec.ts @@ -2,9 +2,9 @@ import type { TestInfo } from '@playwright/test'; import { bothPlatformsIt } from '../../types/sessionIt'; import { USERNAME } from '../../types/testing'; -import { newUser } from './utils/create_account'; -import { createGroup } from './utils/create_group'; -import { closeApp, openAppThreeDevices, SupportedPlatformsType } from './utils/open_app'; +import { newUser } from '../utils/create_account'; +import { createGroup } from '../utils/create_group'; +import { closeApp, openAppThreeDevices, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Create group', diff --git a/run/test/specs/group_tests_create_group_banner.spec.ts b/run/test/specs/group_tests_create_group_banner.spec.ts index a5f57c4a8b..9d842c8a70 100644 --- a/run/test/specs/group_tests_create_group_banner.spec.ts +++ b/run/test/specs/group_tests_create_group_banner.spec.ts @@ -1,11 +1,11 @@ import type { TestInfo } from '@playwright/test'; import { androidIt } from '../../types/sessionIt'; -import { LatestReleaseBanner } from './locators/groups'; -import { PlusButton } from './locators/home'; -import { CreateGroupOption } from './locators/start_conversation'; -import { open_Alice1_Bob1_friends } from './state_builder'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +import { LatestReleaseBanner } from '../locators/groups'; +import { PlusButton } from '../locators/home'; +import { CreateGroupOption } from '../locators/start_conversation'; +import { open_Alice1_Bob1_friends } from '../state_builder'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; // This banner no longer exists on iOS androidIt({ diff --git a/run/test/specs/group_tests_delete_group.spec.ts b/run/test/specs/group_tests_delete_group.spec.ts index c260824a3d..1ec3ce4ec1 100644 --- a/run/test/specs/group_tests_delete_group.spec.ts +++ b/run/test/specs/group_tests_delete_group.spec.ts @@ -1,13 +1,13 @@ import { test, type TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { TestSteps } from '../../types/allure'; import { bothPlatformsIt } from '../../types/sessionIt'; -import { ConversationSettings } from './locators/conversation'; -import { DeleteGroupConfirm, DeleteGroupMenuItem } from './locators/groups'; -import { ConversationItem, PlusButton } from './locators/home'; -import { open_Alice2_Bob1_Charlie1_friends_group } from './state_builder'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +import { ConversationSettings } from '../locators/conversation'; +import { DeleteGroupConfirm, DeleteGroupMenuItem } from '../locators/groups'; +import { ConversationItem, PlusButton } from '../locators/home'; +import { open_Alice2_Bob1_Charlie1_friends_group } from '../state_builder'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Delete group linked device', @@ -39,10 +39,8 @@ async function deleteGroup(platform: SupportedPlatformsType, testInfo: TestInfo) await alice1.clickOnElementAll(new DeleteGroupMenuItem(alice1)); await test.step(TestSteps.VERIFY.SPECIFIC_MODAL('Delete Group'), async () => { await alice1.checkModalStrings( - englishStrippedStr('groupDelete').toString(), - englishStrippedStr('groupDeleteDescription') - .withArgs({ group_name: testGroupName }) - .toString() + tStripped('groupDelete'), + tStripped('groupDeleteDescription', { group_name: testGroupName }) ); }); await alice1.clickOnElementAll(new DeleteGroupConfirm(alice1)); @@ -53,9 +51,7 @@ async function deleteGroup(platform: SupportedPlatformsType, testInfo: TestInfo) await Promise.all( [bob1, charlie1].map(device => device.waitForControlMessageToBePresent( - englishStrippedStr('groupDeletedMemberDescription') - .withArgs({ group_name: testGroupName }) - .toString() + tStripped('groupDeletedMemberDescription', { group_name: testGroupName }) ) ) ); @@ -66,9 +62,9 @@ async function deleteGroup(platform: SupportedPlatformsType, testInfo: TestInfo) device.waitForTextElementToBePresent({ strategy: 'accessibility id', selector: 'Empty list', - text: englishStrippedStr('groupDeletedMemberDescription') - .withArgs({ group_name: testGroupName }) - .toString(), + text: tStripped('groupDeletedMemberDescription', { + group_name: testGroupName, + }), }) ) ); diff --git a/run/test/specs/group_tests_edit_group_banner.spec.ts b/run/test/specs/group_tests_edit_group_banner.spec.ts index 0e9d55c69e..25b295f954 100644 --- a/run/test/specs/group_tests_edit_group_banner.spec.ts +++ b/run/test/specs/group_tests_edit_group_banner.spec.ts @@ -1,10 +1,10 @@ import type { TestInfo } from '@playwright/test'; import { androidIt } from '../../types/sessionIt'; -import { ConversationSettings } from './locators/conversation'; -import { LatestReleaseBanner, ManageMembersMenuItem } from './locators/groups'; -import { open_Alice1_Bob1_Charlie1_friends_group } from './state_builder'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +import { ConversationSettings } from '../locators/conversation'; +import { LatestReleaseBanner, ManageMembersMenuItem } from '../locators/groups'; +import { open_Alice1_Bob1_Charlie1_friends_group } from '../state_builder'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; // This banner no longer exists on iOS androidIt({ diff --git a/run/test/specs/group_tests_invite_contact_banner.spec.ts b/run/test/specs/group_tests_invite_contact_banner.spec.ts index a6bd351e45..0ca8c68418 100644 --- a/run/test/specs/group_tests_invite_contact_banner.spec.ts +++ b/run/test/specs/group_tests_invite_contact_banner.spec.ts @@ -1,11 +1,11 @@ import type { TestInfo } from '@playwright/test'; import { androidIt } from '../../types/sessionIt'; -import { InviteContactsButton } from './locators'; -import { ConversationSettings } from './locators/conversation'; -import { LatestReleaseBanner, ManageMembersMenuItem } from './locators/groups'; -import { open_Alice1_Bob1_Charlie1_friends_group } from './state_builder'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +import { InviteContactsButton } from '../locators'; +import { ConversationSettings } from '../locators/conversation'; +import { LatestReleaseBanner, ManageMembersMenuItem } from '../locators/groups'; +import { open_Alice1_Bob1_Charlie1_friends_group } from '../state_builder'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; // This banner no longer exists on iOS androidIt({ diff --git a/run/test/specs/group_tests_kick_member.spec.ts b/run/test/specs/group_tests_kick_member.spec.ts index 3c3a1555ac..6c70746704 100644 --- a/run/test/specs/group_tests_kick_member.spec.ts +++ b/run/test/specs/group_tests_kick_member.spec.ts @@ -1,17 +1,17 @@ import type { TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { bothPlatformsIt } from '../../types/sessionIt'; import { USERNAME } from '../../types/testing'; -import { ConversationSettings, MessageInput } from './locators/conversation'; +import { ConversationSettings, MessageInput } from '../locators/conversation'; import { ConfirmRemovalButton, GroupMember, ManageMembersMenuItem, RemoveMemberButton, -} from './locators/groups'; -import { open_Alice1_Bob1_Charlie1_friends_group } from './state_builder'; -import { SupportedPlatformsType } from './utils/open_app'; +} from '../locators/groups'; +import { open_Alice1_Bob1_Charlie1_friends_group } from '../state_builder'; +import { SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Kick member', @@ -42,10 +42,11 @@ async function kickMember(platform: SupportedPlatformsType, testInfo: TestInfo) await alice1.clickOnElementAll({ ...new GroupMember(alice1).build(USERNAME.BOB) }); await alice1.clickOnElementAll(new RemoveMemberButton(alice1)); await alice1.checkModalStrings( - englishStrippedStr('remove').toString(), - englishStrippedStr('groupRemoveDescription') - .withArgs({ name: USERNAME.BOB, group_name: testGroupName }) - .toString() + tStripped('remove'), + tStripped('groupRemoveDescription', { + name: USERNAME.BOB, + group_name: testGroupName, + }) ); await alice1.clickOnElementAll(new ConfirmRemovalButton(alice1)); // The Group Member element sometimes disappears slowly, sometimes quickly. @@ -57,17 +58,13 @@ async function kickMember(platform: SupportedPlatformsType, testInfo: TestInfo) await alice1.navigateBack(); await alice1.navigateBack(); await Promise.all([ - alice1.waitForControlMessageToBePresent( - englishStrippedStr('groupRemoved').withArgs({ name: USERNAME.BOB }).toString() - ), - charlie1.waitForControlMessageToBePresent( - englishStrippedStr('groupRemoved').withArgs({ name: USERNAME.BOB }).toString() - ), + alice1.waitForControlMessageToBePresent(tStripped('groupRemoved', { name: USERNAME.BOB })), + charlie1.waitForControlMessageToBePresent(tStripped('groupRemoved', { name: USERNAME.BOB })), ]); await bob1.onAndroid().waitForTextElementToBePresent({ strategy: 'accessibility id', selector: 'Empty list', - text: englishStrippedStr('groupRemovedYou').withArgs({ group_name: testGroupName }).toString(), + text: tStripped('groupRemovedYou', { group_name: testGroupName }), }); await bob1.onIOS().waitForTextElementToBePresent({ strategy: 'accessibility id', diff --git a/run/test/specs/group_tests_leave_group.spec.ts b/run/test/specs/group_tests_leave_group.spec.ts index e3dbde48a3..bbe1e5ca55 100644 --- a/run/test/specs/group_tests_leave_group.spec.ts +++ b/run/test/specs/group_tests_leave_group.spec.ts @@ -1,13 +1,13 @@ import type { TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { bothPlatformsIt } from '../../types/sessionIt'; -import { ConversationSettings } from './locators/conversation'; -import { LeaveGroupConfirm, LeaveGroupMenuItem } from './locators/groups'; -import { ConversationItem } from './locators/home'; -import { open_Alice1_Bob1_Charlie1_friends_group } from './state_builder'; -import { sleepFor } from './utils/index'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +import { ConversationSettings } from '../locators/conversation'; +import { LeaveGroupConfirm, LeaveGroupMenuItem } from '../locators/groups'; +import { ConversationItem } from '../locators/home'; +import { open_Alice1_Bob1_Charlie1_friends_group } from '../state_builder'; +import { sleepFor } from '../utils/index'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Leave group', @@ -38,14 +38,12 @@ async function leaveGroup(platform: SupportedPlatformsType, testInfo: TestInfo) await charlie1.clickOnElementAll(new LeaveGroupMenuItem(charlie1)); // Modal with Leave/Cancel await charlie1.checkModalStrings( - englishStrippedStr('groupLeave').toString(), - englishStrippedStr('groupLeaveDescription').withArgs({ group_name: testGroupName }).toString() + tStripped('groupLeave'), + tStripped('groupLeaveDescription', { group_name: testGroupName }) ); await charlie1.clickOnElementAll(new LeaveGroupConfirm(charlie1)); // Check for control message - const groupMemberLeft = englishStrippedStr('groupMemberLeft') - .withArgs({ name: charlie.userName }) - .toString(); + const groupMemberLeft = tStripped('groupMemberLeft', { name: charlie.userName }); await alice1.waitForControlMessageToBePresent(groupMemberLeft); await bob1.waitForControlMessageToBePresent(groupMemberLeft); // Check device 3 that group has disappeared diff --git a/run/test/specs/group_tests_mentions.spec.ts b/run/test/specs/group_tests_mentions.spec.ts index d64013d3da..3563c8557a 100644 --- a/run/test/specs/group_tests_mentions.spec.ts +++ b/run/test/specs/group_tests_mentions.spec.ts @@ -1,9 +1,9 @@ import type { TestInfo } from '@playwright/test'; import { bothPlatformsIt } from '../../types/sessionIt'; -import { MessageBody } from './locators/conversation'; -import { open_Alice1_Bob1_Charlie1_friends_group } from './state_builder'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +import { MessageBody } from '../locators/conversation'; +import { open_Alice1_Bob1_Charlie1_friends_group } from '../state_builder'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Mentions for groups', diff --git a/run/test/specs/invite_a_friend_share.spec.ts b/run/test/specs/invite_a_friend_share.spec.ts index a1afa55d00..20a20bc704 100644 --- a/run/test/specs/invite_a_friend_share.spec.ts +++ b/run/test/specs/invite_a_friend_share.spec.ts @@ -3,11 +3,11 @@ import type { TestInfo } from '@playwright/test'; import { IOS_XPATHS } from '../../constants'; import { bothPlatformsIt } from '../../types/sessionIt'; import { USERNAME } from '../../types/testing'; -import { AccountIDDisplay } from './locators/global'; -import { PlusButton } from './locators/home'; -import { InviteAFriendOption, ShareButton } from './locators/start_conversation'; -import { newUser } from './utils/create_account'; -import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from './utils/open_app'; +import { AccountIDDisplay } from '../locators/global'; +import { PlusButton } from '../locators/home'; +import { InviteAFriendOption, ShareButton } from '../locators/start_conversation'; +import { newUser } from '../utils/create_account'; +import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Invite a friend', diff --git a/run/test/specs/landing_page_new_account.spec.ts b/run/test/specs/landing_page_new_account.spec.ts index 90970f1a3c..e057e40785 100644 --- a/run/test/specs/landing_page_new_account.spec.ts +++ b/run/test/specs/landing_page_new_account.spec.ts @@ -2,9 +2,9 @@ import { type TestInfo } from '@playwright/test'; import { bothPlatformsIt } from '../../types/sessionIt'; import { USERNAME } from '../../types/testing'; -import { newUser } from './utils/create_account'; -import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from './utils/open_app'; -import { verifyPageScreenshot } from './utils/verify_screenshots'; +import { newUser } from '../utils/create_account'; +import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from '../utils/open_app'; +import { verifyPageScreenshot } from '../utils/verify_screenshots'; bothPlatformsIt({ title: 'Check landing page (new account) layout', diff --git a/run/test/specs/landing_page_restore_account.spec.ts b/run/test/specs/landing_page_restore_account.spec.ts index d7d9883346..1064e97104 100644 --- a/run/test/specs/landing_page_restore_account.spec.ts +++ b/run/test/specs/landing_page_restore_account.spec.ts @@ -3,9 +3,9 @@ import type { TestInfo } from '@playwright/test'; import { USERNAME } from '@session-foundation/qa-seeder'; import { bothPlatformsIt } from '../../types/sessionIt'; -import { linkedDevice } from './utils/link_device'; -import { closeApp, openAppTwoDevices, SupportedPlatformsType } from './utils/open_app'; -import { verifyPageScreenshot } from './utils/verify_screenshots'; +import { linkedDevice } from '../utils/link_device'; +import { closeApp, openAppTwoDevices, SupportedPlatformsType } from '../utils/open_app'; +import { verifyPageScreenshot } from '../utils/verify_screenshots'; bothPlatformsIt({ title: 'Check landing page (restored account) layout', diff --git a/run/test/specs/linked_device.spec.ts b/run/test/specs/linked_device.spec.ts index 03983bc4eb..27c5936253 100644 --- a/run/test/specs/linked_device.spec.ts +++ b/run/test/specs/linked_device.spec.ts @@ -3,11 +3,11 @@ import type { TestInfo } from '@playwright/test'; import { USERNAME } from '@session-foundation/qa-seeder'; import { bothPlatformsIt } from '../../types/sessionIt'; -import { UsernameDisplay } from './locators'; -import { AccountIDDisplay } from './locators/global'; -import { UserSettings } from './locators/settings'; -import { linkedDevice } from './utils/link_device'; -import { closeApp, openAppTwoDevices, SupportedPlatformsType } from './utils/open_app'; +import { UsernameDisplay } from '../locators'; +import { AccountIDDisplay } from '../locators/global'; +import { UserSettings } from '../locators/settings'; +import { linkedDevice } from '../utils/link_device'; +import { closeApp, openAppTwoDevices, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Link device', diff --git a/run/test/specs/linked_device_avatar_color.spec.ts b/run/test/specs/linked_device_avatar_color.spec.ts index cd411b3400..cdfee90e2d 100644 --- a/run/test/specs/linked_device_avatar_color.spec.ts +++ b/run/test/specs/linked_device_avatar_color.spec.ts @@ -1,10 +1,10 @@ import type { TestInfo } from '@playwright/test'; import { bothPlatformsIt } from '../../types/sessionIt'; -import { UserSettings } from './locators/settings'; -import { open_Alice2 } from './state_builder'; -import { isSameColor } from './utils/check_colour'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +import { UserSettings } from '../locators/settings'; +import { open_Alice2 } from '../state_builder'; +import { isSameColor } from '../utils/check_colour'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Avatar color linked device', diff --git a/run/test/specs/linked_device_block_user.spec.ts b/run/test/specs/linked_device_block_user.spec.ts index d288886abd..900e0c8245 100644 --- a/run/test/specs/linked_device_block_user.spec.ts +++ b/run/test/specs/linked_device_block_user.spec.ts @@ -1,15 +1,15 @@ import type { TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { bothPlatformsIt } from '../../types/sessionIt'; -import { BlockedContactsSettings, BlockUser, BlockUserConfirmationModal } from './locators'; -import { BlockedBanner, ConversationSettings } from './locators/conversation'; -import { Contact } from './locators/global'; -import { ConversationItem } from './locators/home'; -import { ConversationsMenuItem, UserSettings } from './locators/settings'; -import { open_Alice2_Bob1_friends } from './state_builder'; -import { sleepFor } from './utils'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +import { BlockedContactsSettings, BlockUser, BlockUserConfirmationModal } from '../locators'; +import { BlockedBanner, ConversationSettings } from '../locators/conversation'; +import { Contact } from '../locators/global'; +import { ConversationItem } from '../locators/home'; +import { ConversationsMenuItem, UserSettings } from '../locators/settings'; +import { open_Alice2_Bob1_friends } from '../state_builder'; +import { sleepFor } from '../utils'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Block user linked device', @@ -37,8 +37,8 @@ async function blockUserInConversationOptions( await sleepFor(500); await alice1.clickOnElementAll(new BlockUser(alice1)); await alice1.checkModalStrings( - englishStrippedStr('block').toString(), - englishStrippedStr('blockDescription').withArgs({ name: bob.userName }).toString() + tStripped('block'), + tStripped('blockDescription', { name: bob.userName }) ); // Confirm block option await alice1.clickOnElementAll(new BlockUserConfirmationModal(alice1)); diff --git a/run/test/specs/linked_device_change_username.spec.ts b/run/test/specs/linked_device_change_username.spec.ts index 7193e883ff..6a5a80c7f8 100644 --- a/run/test/specs/linked_device_change_username.spec.ts +++ b/run/test/specs/linked_device_change_username.spec.ts @@ -1,11 +1,11 @@ import type { TestInfo } from '@playwright/test'; import { bothPlatformsIt } from '../../types/sessionIt'; -import { ClearInputButton, EditUsernameButton, UsernameDisplay, UsernameInput } from './locators'; -import { SaveNameChangeButton, UserSettings } from './locators/settings'; -import { open_Alice2 } from './state_builder'; -import { sleepFor } from './utils'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +import { ClearInputButton, EditUsernameButton, UsernameDisplay, UsernameInput } from '../locators'; +import { SaveNameChangeButton, UserSettings } from '../locators/settings'; +import { open_Alice2 } from '../state_builder'; +import { sleepFor } from '../utils'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Change username linked device', diff --git a/run/test/specs/linked_device_create_group.spec.ts b/run/test/specs/linked_device_create_group.spec.ts index 64931e5dc9..19f23b3d8a 100644 --- a/run/test/specs/linked_device_create_group.spec.ts +++ b/run/test/specs/linked_device_create_group.spec.ts @@ -1,20 +1,20 @@ import type { TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { bothPlatformsItSeparate } from '../../types/sessionIt'; import { USERNAME } from '../../types/testing'; -import { ConversationHeaderName, ConversationSettings } from './locators/conversation'; +import { ConversationHeaderName, ConversationSettings } from '../locators/conversation'; import { EditGroupNameInput, SaveGroupNameChangeButton, UpdateGroupInformation, -} from './locators/groups'; -import { ConversationItem } from './locators/home'; -import { sleepFor } from './utils'; -import { newUser } from './utils/create_account'; -import { createGroup } from './utils/create_group'; -import { linkedDevice } from './utils/link_device'; -import { closeApp, openAppFourDevices, SupportedPlatformsType } from './utils/open_app'; +} from '../locators/groups'; +import { ConversationItem } from '../locators/home'; +import { sleepFor } from '../utils'; +import { newUser } from '../utils/create_account'; +import { createGroup } from '../utils/create_group'; +import { linkedDevice } from '../utils/link_device'; +import { closeApp, openAppFourDevices, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsItSeparate({ title: 'Create group and change name syncs', @@ -56,8 +56,8 @@ async function linkedGroupiOS(platform: SupportedPlatformsType, testInfo: TestIn await device1.clickOnElementAll(new UpdateGroupInformation(device1, testGroupName)); // Check new dialog await device1.checkModalStrings( - englishStrippedStr('updateGroupInformation').toString(), - englishStrippedStr('updateGroupInformationDescription').toString() + tStripped('updateGroupInformation'), + tStripped('updateGroupInformationDescription') ); // Delete old name first await device1.deleteText(new EditGroupNameInput(device1)); @@ -68,9 +68,7 @@ async function linkedGroupiOS(platform: SupportedPlatformsType, testInfo: TestIn // Go back to conversation await device1.navigateBack(); // Check control message for changed name - const groupNameNew = englishStrippedStr('groupNameNew') - .withArgs({ group_name: newGroupName }) - .toString(); + const groupNameNew = tStripped('groupNameNew', { group_name: newGroupName }); // Control message should be "Group name is now {group_name}." await device1.waitForControlMessageToBePresent(groupNameNew); // Wait 5 seconds for name to update @@ -116,9 +114,7 @@ async function linkedGroupAndroid(platform: SupportedPlatformsType, testInfo: Te await device1.clickOnElementAll(new SaveGroupNameChangeButton(device1)); await device1.navigateBack(); // Check control message for changed name - const groupNameNew = englishStrippedStr('groupNameNew') - .withArgs({ group_name: newGroupName }) - .toString(); + const groupNameNew = tStripped('groupNameNew', { group_name: newGroupName }); // Config message is "Group name is now {group_name}" await device1.waitForControlMessageToBePresent(groupNameNew); // Check linked device for name change (conversation header name) diff --git a/run/test/specs/linked_device_delete_message.spec.ts b/run/test/specs/linked_device_delete_message.spec.ts index 0704a61fff..efb586cc66 100644 --- a/run/test/specs/linked_device_delete_message.spec.ts +++ b/run/test/specs/linked_device_delete_message.spec.ts @@ -1,12 +1,12 @@ import type { TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { bothPlatformsIt } from '../../types/sessionIt'; -import { DeleteMessageConfirmationModal } from './locators'; -import { DeletedMessage, MessageBody } from './locators/conversation'; -import { ConversationItem } from './locators/home'; -import { open_Alice2_Bob1_friends } from './state_builder'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +import { DeleteMessageConfirmationModal } from '../locators'; +import { DeletedMessage, MessageBody } from '../locators/conversation'; +import { ConversationItem } from '../locators/home'; +import { open_Alice2_Bob1_friends } from '../state_builder'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Delete message linked device', @@ -38,8 +38,8 @@ async function deletedMessageLinkedDevice(platform: SupportedPlatformsType, test // Select delete await alice1.clickOnByAccessibilityID('Delete message'); await alice1.checkModalStrings( - englishStrippedStr('deleteMessage').withArgs({ count: 1 }).toString(), - englishStrippedStr('deleteMessageConfirm').withArgs({ count: 1 }).toString() + tStripped('deleteMessage', { count: 1 }), + tStripped('deleteMessageConfirm', { count: 1 }) ); await alice1.clickOnElementAll(new DeleteMessageConfirmationModal(alice1)); // Check linked device for deleted message diff --git a/run/test/specs/linked_device_hide_note_to_self.spec.ts b/run/test/specs/linked_device_hide_note_to_self.spec.ts index e6e02d740a..24381e4e4d 100644 --- a/run/test/specs/linked_device_hide_note_to_self.spec.ts +++ b/run/test/specs/linked_device_hide_note_to_self.spec.ts @@ -1,13 +1,13 @@ import { test, type TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { TestSteps } from '../../types/allure'; import { bothPlatformsIt } from '../../types/sessionIt'; -import { EmptyConversation, Hide } from './locators/conversation'; -import { CancelSearchButton, NoteToSelfOption } from './locators/global_search'; -import { ConversationItem, SearchButton } from './locators/home'; -import { open_Alice2 } from './state_builder'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +import { EmptyConversation, Hide } from '../locators/conversation'; +import { CancelSearchButton, NoteToSelfOption } from '../locators/global_search'; +import { ConversationItem, SearchButton } from '../locators/home'; +import { open_Alice2 } from '../state_builder'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Hide note to self linked device', @@ -27,7 +27,7 @@ async function hideNoteToSelf(platform: SupportedPlatformsType, testInfo: TestIn }); const { alice1, alice2 } = devices; - const noteToSelf = englishStrippedStr('noteToSelf').toString(); + const noteToSelf = tStripped('noteToSelf'); await test.step('Open Note to Self and send a message', async () => { await alice1.clickOnElementAll(new SearchButton(alice1)); await alice1.clickOnElementAll(new NoteToSelfOption(alice1)); @@ -46,8 +46,8 @@ async function hideNoteToSelf(platform: SupportedPlatformsType, testInfo: TestIn await alice1.clickOnElementAll(new Hide(alice1)); await test.step(TestSteps.VERIFY.GENERIC_MODAL, async () => { await alice1.checkModalStrings( - englishStrippedStr('noteToSelfHide').toString(), - englishStrippedStr('hideNoteToSelfDescription').toString() // This one fails on iOS, see SES-4144 + tStripped('noteToSelfHide'), + tStripped('hideNoteToSelfDescription') // This one fails on iOS, see SES-4144 ); }); await alice1.clickOnByAccessibilityID('Hide'); diff --git a/run/test/specs/linked_device_profile_picture_syncs.spec.ts b/run/test/specs/linked_device_profile_picture_syncs.spec.ts index d0247023b4..89d8a363aa 100644 --- a/run/test/specs/linked_device_profile_picture_syncs.spec.ts +++ b/run/test/specs/linked_device_profile_picture_syncs.spec.ts @@ -2,9 +2,9 @@ import { test, type TestInfo } from '@playwright/test'; import { TestSteps } from '../../types/allure'; import { bothPlatformsIt } from '../../types/sessionIt'; -import { UserAvatar, UserSettings } from './locators/settings'; -import { open_Alice2 } from './state_builder'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +import { UserAvatar, UserSettings } from '../locators/settings'; +import { open_Alice2 } from '../state_builder'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Change profile picture linked device', diff --git a/run/test/specs/linked_device_restore_group.spec.ts b/run/test/specs/linked_device_restore_group.spec.ts index 289e53d832..787bd8f661 100644 --- a/run/test/specs/linked_device_restore_group.spec.ts +++ b/run/test/specs/linked_device_restore_group.spec.ts @@ -2,12 +2,12 @@ import type { TestInfo } from '@playwright/test'; import { bothPlatformsIt } from '../../types/sessionIt'; import { USERNAME } from '../../types/testing'; -import { ConversationHeaderName, MessageBody } from './locators/conversation'; -import { ConversationItem } from './locators/home'; -import { newUser } from './utils/create_account'; -import { createGroup } from './utils/create_group'; -import { closeApp, openAppFourDevices, SupportedPlatformsType } from './utils/open_app'; -import { restoreAccount } from './utils/restore_account'; +import { ConversationHeaderName, MessageBody } from '../locators/conversation'; +import { ConversationItem } from '../locators/home'; +import { newUser } from '../utils/create_account'; +import { createGroup } from '../utils/create_group'; +import { closeApp, openAppFourDevices, SupportedPlatformsType } from '../utils/open_app'; +import { restoreAccount } from '../utils/restore_account'; bothPlatformsIt({ title: 'Restore group', diff --git a/run/test/specs/linked_device_unsend_message.spec.ts b/run/test/specs/linked_device_unsend_message.spec.ts index dedc0a5b4b..2aabc0ce19 100644 --- a/run/test/specs/linked_device_unsend_message.spec.ts +++ b/run/test/specs/linked_device_unsend_message.spec.ts @@ -1,13 +1,13 @@ import { test, type TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { TestSteps } from '../../types/allure'; import { bothPlatformsIt } from '../../types/sessionIt'; -import { DeleteMessageConfirmationModal, DeleteMessageForEveryone } from './locators'; -import { DeletedMessage, MessageBody } from './locators/conversation'; -import { ConversationItem, MessageSnippet } from './locators/home'; -import { open_Alice2_Bob1_friends } from './state_builder'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +import { DeleteMessageConfirmationModal, DeleteMessageForEveryone } from '../locators'; +import { DeletedMessage, MessageBody } from '../locators/conversation'; +import { ConversationItem, MessageSnippet } from '../locators/home'; +import { open_Alice2_Bob1_friends } from '../state_builder'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Unsent message syncs', @@ -56,8 +56,8 @@ async function unSendMessageLinkedDevice(platform: SupportedPlatformsType, testI await alice1.clickOnByAccessibilityID('Delete message'); await test.step(TestSteps.VERIFY.SPECIFIC_MODAL('Delete message'), async () => { await alice1.checkModalStrings( - englishStrippedStr('deleteMessage').withArgs({ count: 1 }).toString(), - englishStrippedStr('deleteMessageConfirm').withArgs({ count: 1 }).toString() + tStripped('deleteMessage', { count: 1 }), + tStripped('deleteMessageConfirm', { count: 1 }) ); }); await alice1.clickOnElementAll(new DeleteMessageForEveryone(alice1)); diff --git a/run/test/specs/linked_group_leave.spec.ts b/run/test/specs/linked_group_leave.spec.ts index 4a0b162290..0d0c625145 100644 --- a/run/test/specs/linked_group_leave.spec.ts +++ b/run/test/specs/linked_group_leave.spec.ts @@ -1,16 +1,16 @@ import type { TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { bothPlatformsIt } from '../../types/sessionIt'; import { USERNAME } from '../../types/testing'; -import { ConversationSettings } from './locators/conversation'; -import { LeaveGroupConfirm, LeaveGroupMenuItem } from './locators/groups'; -import { ConversationItem } from './locators/home'; -import { sleepFor } from './utils'; -import { newUser } from './utils/create_account'; -import { createGroup } from './utils/create_group'; -import { linkedDevice } from './utils/link_device'; -import { closeApp, openAppFourDevices, SupportedPlatformsType } from './utils/open_app'; +import { ConversationSettings } from '../locators/conversation'; +import { LeaveGroupConfirm, LeaveGroupMenuItem } from '../locators/groups'; +import { ConversationItem } from '../locators/home'; +import { sleepFor } from '../utils'; +import { newUser } from '../utils/create_account'; +import { createGroup } from '../utils/create_group'; +import { linkedDevice } from '../utils/link_device'; +import { closeApp, openAppFourDevices, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Leave group linked device', @@ -40,8 +40,8 @@ async function leaveGroupLinkedDevice(platform: SupportedPlatformsType, testInfo await sleepFor(1000); await device3.clickOnElementAll(new LeaveGroupMenuItem(device3)); await device3.checkModalStrings( - englishStrippedStr('groupLeave').toString(), - englishStrippedStr('groupLeaveDescription').withArgs({ group_name: testGroupName }).toString() + tStripped('groupLeave'), + tStripped('groupLeaveDescription', { group_name: testGroupName }) ); // Modal with Leave/Cancel await device3.clickOnElementAll(new LeaveGroupConfirm(device3)); @@ -51,9 +51,7 @@ async function leaveGroupLinkedDevice(platform: SupportedPlatformsType, testInfo device4.hasElementBeenDeleted(new ConversationItem(device4, testGroupName)), ]); // Create control message for user leaving group - const groupMemberLeft = englishStrippedStr('groupMemberLeft') - .withArgs({ name: charlie.userName }) - .toString(); + const groupMemberLeft = tStripped('groupMemberLeft', { name: charlie.userName }); await Promise.all([ device1.waitForControlMessageToBePresent(groupMemberLeft), device2.waitForControlMessageToBePresent(groupMemberLeft), diff --git a/run/test/specs/message_check_performance.spec.ts b/run/test/specs/message_check_performance.spec.ts index 5212a48058..c26504f7f7 100644 --- a/run/test/specs/message_check_performance.spec.ts +++ b/run/test/specs/message_check_performance.spec.ts @@ -1,8 +1,8 @@ import type { TestInfo } from '@playwright/test'; import { bothPlatformsIt } from '../../types/sessionIt'; -import { open_Alice1_Bob1_friends } from './state_builder'; -import { SupportedPlatformsType } from './utils/open_app'; +import { open_Alice1_Bob1_friends } from '../state_builder'; +import { SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Check performance', diff --git a/run/test/specs/message_community_invitation.spec.ts b/run/test/specs/message_community_invitation.spec.ts index 0b60ff8f9c..34f15ba7c6 100644 --- a/run/test/specs/message_community_invitation.spec.ts +++ b/run/test/specs/message_community_invitation.spec.ts @@ -1,20 +1,20 @@ import type { TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { bothPlatformsIt } from '../../types/sessionIt'; -import { testCommunityLink, testCommunityName } from './../../constants/community'; -import { InviteContactsMenuItem, JoinCommunityModalButton } from './locators'; +import { InviteContactsMenuItem, JoinCommunityModalButton } from '../locators'; import { CommunityInvitation, CommunityInviteConfirmButton, ConversationSettings, -} from './locators/conversation'; -import { GroupMember } from './locators/groups'; -import { ConversationItem } from './locators/home'; -import { open_Alice1_Bob1_friends } from './state_builder'; -import { sleepFor } from './utils'; -import { joinCommunity } from './utils/join_community'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +} from '../locators/conversation'; +import { GroupMember } from '../locators/groups'; +import { ConversationItem } from '../locators/home'; +import { open_Alice1_Bob1_friends } from '../state_builder'; +import { sleepFor } from '../utils'; +import { joinCommunity } from '../utils/join_community'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; +import { testCommunityLink, testCommunityName } from './../../constants/community'; bothPlatformsIt({ title: 'Send community invitation', @@ -44,10 +44,8 @@ async function sendCommunityInvitation(platform: SupportedPlatformsType, testInf await bob1.waitForTextElementToBePresent(new CommunityInvitation(bob1)); await bob1.clickOnElementAll(new CommunityInvitation(bob1)); await bob1.checkModalStrings( - englishStrippedStr('communityJoin').toString(), - englishStrippedStr('communityJoinDescription') - .withArgs({ community_name: testCommunityName }) - .toString() + tStripped('communityJoin'), + tStripped('communityJoinDescription', { community_name: testCommunityName }) ); await bob1.clickOnElementAll(new JoinCommunityModalButton(bob1)); await bob1.navigateBack(); diff --git a/run/test/specs/message_deletion.spec.ts b/run/test/specs/message_deletion.spec.ts index 9a3b2068a8..c177f1a44b 100644 --- a/run/test/specs/message_deletion.spec.ts +++ b/run/test/specs/message_deletion.spec.ts @@ -1,11 +1,11 @@ import type { TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { bothPlatformsIt } from '../../types/sessionIt'; -import { DeleteMessageConfirmationModal, DeleteMessageLocally } from './locators'; -import { DeletedMessage, MessageBody } from './locators/conversation'; -import { open_Alice1_Bob1_friends } from './state_builder'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +import { DeleteMessageConfirmationModal, DeleteMessageLocally } from '../locators'; +import { DeletedMessage, MessageBody } from '../locators/conversation'; +import { open_Alice1_Bob1_friends } from '../state_builder'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Delete message locally', @@ -30,8 +30,8 @@ async function deleteMessage(platform: SupportedPlatformsType, testInfo: TestInf // Select Delete icon await alice1.clickOnByAccessibilityID('Delete message'); await alice1.checkModalStrings( - englishStrippedStr('deleteMessage').withArgs({ count: 1 }).toString(), - englishStrippedStr('deleteMessageConfirm').withArgs({ count: 1 }).toString() + tStripped('deleteMessage', { count: 1 }), + tStripped('deleteMessageConfirm', { count: 1 }) ); // Select 'Delete on this device only' await alice1.clickOnElementAll(new DeleteMessageLocally(alice1)); diff --git a/run/test/specs/message_document.spec.ts b/run/test/specs/message_document.spec.ts index 2d684a7edf..1579c742f4 100644 --- a/run/test/specs/message_document.spec.ts +++ b/run/test/specs/message_document.spec.ts @@ -1,10 +1,10 @@ import type { TestInfo } from '@playwright/test'; import { bothPlatformsIt } from '../../types/sessionIt'; -import { DocumentMessage, MessageBody } from './locators/conversation'; -import { open_Alice1_Bob1_friends } from './state_builder'; -import { sleepFor } from './utils'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +import { DocumentMessage, MessageBody } from '../locators/conversation'; +import { open_Alice1_Bob1_friends } from '../state_builder'; +import { sleepFor } from '../utils'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Send document 1:1', diff --git a/run/test/specs/message_gif.spec.ts b/run/test/specs/message_gif.spec.ts index 0c28a87e76..ae67c4a302 100644 --- a/run/test/specs/message_gif.spec.ts +++ b/run/test/specs/message_gif.spec.ts @@ -1,10 +1,10 @@ import type { TestInfo } from '@playwright/test'; import { bothPlatformsIt } from '../../types/sessionIt'; -import { MediaMessage, MessageBody } from './locators/conversation'; -import { open_Alice1_Bob1_friends } from './state_builder'; -import { sleepFor } from './utils'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +import { MediaMessage, MessageBody } from '../locators/conversation'; +import { open_Alice1_Bob1_friends } from '../state_builder'; +import { sleepFor } from '../utils'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Send GIF 1:1', diff --git a/run/test/specs/message_image.spec.ts b/run/test/specs/message_image.spec.ts index 17eed7e092..3854685856 100644 --- a/run/test/specs/message_image.spec.ts +++ b/run/test/specs/message_image.spec.ts @@ -1,9 +1,9 @@ import type { TestInfo } from '@playwright/test'; import { bothPlatformsIt } from '../../types/sessionIt'; -import { MessageBody } from './locators/conversation'; -import { open_Alice1_Bob1_friends } from './state_builder'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +import { MessageBody } from '../locators/conversation'; +import { open_Alice1_Bob1_friends } from '../state_builder'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Send image 1:1', diff --git a/run/test/specs/message_length.spec.ts b/run/test/specs/message_length.spec.ts index e2c1fea4fc..b04b27d0b0 100644 --- a/run/test/specs/message_length.spec.ts +++ b/run/test/specs/message_length.spec.ts @@ -1,6 +1,6 @@ import { test, type TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { TestSteps } from '../../types/allure'; import { bothPlatformsIt } from '../../types/sessionIt'; import { USERNAME } from '../../types/testing'; @@ -10,11 +10,11 @@ import { MessageLengthCountdown, MessageLengthOkayButton, SendButton, -} from './locators/conversation'; -import { PlusButton } from './locators/home'; -import { EnterAccountID, NewMessageOption, NextButton } from './locators/start_conversation'; -import { newUser } from './utils/create_account'; -import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from './utils/open_app'; +} from '../locators/conversation'; +import { PlusButton } from '../locators/home'; +import { EnterAccountID, NewMessageOption, NextButton } from '../locators/start_conversation'; +import { newUser } from '../utils/create_account'; +import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from '../utils/open_app'; const maxChars = 2000; const countdownThreshold = 1800; @@ -87,10 +87,8 @@ for (const testCase of messageLengthTestCases) { } else { // Modal appears, verify and dismiss await device.checkModalStrings( - englishStrippedStr('modalMessageTooLongTitle').toString(), - englishStrippedStr('modalMessageTooLongDescription') - .withArgs({ limit: maxChars.toString() }) - .toString() + tStripped('modalMessageTooLongTitle'), + tStripped('modalMessageTooLongDescription', { limit: maxChars.toString() }) ); await device.clickOnElementAll(new MessageLengthOkayButton(device)); await device.verifyElementNotPresent(new MessageBody(device, message)); diff --git a/run/test/specs/message_link_preview.spec.ts b/run/test/specs/message_link_preview.spec.ts index 2ce27c8a19..33bc8ced6b 100644 --- a/run/test/specs/message_link_preview.spec.ts +++ b/run/test/specs/message_link_preview.spec.ts @@ -1,19 +1,19 @@ import type { TestInfo } from '@playwright/test'; import { testLink } from '../../constants'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { bothPlatformsItSeparate } from '../../types/sessionIt'; -import { LinkPreview, LinkPreviewMessage } from './locators'; +import { LinkPreview, LinkPreviewMessage } from '../locators'; import { MessageBody, MessageInput, OutgoingMessageStatusSent, SendButton, -} from './locators/conversation'; -import { EnableLinkPreviewsModalButton } from './locators/global'; -import { open_Alice1_Bob1_friends } from './state_builder'; -import { sleepFor } from './utils'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +} from '../locators/conversation'; +import { EnableLinkPreviewsModalButton } from '../locators/global'; +import { open_Alice1_Bob1_friends } from '../state_builder'; +import { sleepFor } from '../utils'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsItSeparate({ title: 'Send link 1:1', @@ -43,8 +43,8 @@ async function sendLinkIos(platform: SupportedPlatformsType, testInfo: TestInfo) await alice1.inputText(testLink, new MessageInput(alice1)); // Accept dialog for link preview await alice1.checkModalStrings( - englishStrippedStr('linkPreviewsEnable').toString(), - englishStrippedStr('linkPreviewsFirstDescription').toString() + tStripped('linkPreviewsEnable'), + tStripped('linkPreviewsFirstDescription') ); await alice1.clickOnElementAll(new EnableLinkPreviewsModalButton(alice1)); await alice1.clickOnElementAll(new SendButton(alice1)); @@ -79,8 +79,8 @@ async function sendLinkAndroid(platform: SupportedPlatformsType, testInfo: TestI await alice1.inputText(testLink, new MessageInput(alice1)); // Accept dialog for link preview await alice1.checkModalStrings( - englishStrippedStr('linkPreviewsEnable').toString(), - englishStrippedStr('linkPreviewsFirstDescription').toString() + tStripped('linkPreviewsEnable'), + tStripped('linkPreviewsFirstDescription') ); await alice1.clickOnElementAll(new EnableLinkPreviewsModalButton(alice1)); //wait for preview to generate diff --git a/run/test/specs/message_long_text.spec.ts b/run/test/specs/message_long_text.spec.ts index 0e644a3fb8..5d09c2b8ce 100644 --- a/run/test/specs/message_long_text.spec.ts +++ b/run/test/specs/message_long_text.spec.ts @@ -7,11 +7,11 @@ import { MessageInput, OutgoingMessageStatusSent, SendButton, -} from './locators/conversation'; -import { ConversationItem } from './locators/home'; -import { open_Alice1_Bob1_friends } from './state_builder'; -import { sleepFor } from './utils'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +} from '../locators/conversation'; +import { ConversationItem } from '../locators/home'; +import { open_Alice1_Bob1_friends } from '../state_builder'; +import { sleepFor } from '../utils'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsItSeparate({ title: 'Send long message 1:1', diff --git a/run/test/specs/message_reaction.spec.ts b/run/test/specs/message_reaction.spec.ts index 20f4b53994..85db6ce6f4 100644 --- a/run/test/specs/message_reaction.spec.ts +++ b/run/test/specs/message_reaction.spec.ts @@ -2,9 +2,9 @@ import { test, type TestInfo } from '@playwright/test'; import { TestSteps } from '../../types/allure'; import { bothPlatformsIt } from '../../types/sessionIt'; -import { EmojiReactsPill, FirstEmojiReact, MessageBody } from './locators/conversation'; -import { open_Alice1_Bob1_friends } from './state_builder'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +import { EmojiReactsPill, FirstEmojiReact, MessageBody } from '../locators/conversation'; +import { open_Alice1_Bob1_friends } from '../state_builder'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Send emoji react 1:1', diff --git a/run/test/specs/message_requests_accept.spec.ts b/run/test/specs/message_requests_accept.spec.ts index cdce726239..9d933fb492 100644 --- a/run/test/specs/message_requests_accept.spec.ts +++ b/run/test/specs/message_requests_accept.spec.ts @@ -1,12 +1,12 @@ import type { TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { bothPlatformsIt } from '../../types/sessionIt'; import { USERNAME } from '../../types/testing'; -import { ConversationItem, MessageRequestsBanner } from './locators/home'; -import { newUser } from './utils/create_account'; -import { linkedDevice } from './utils/link_device'; -import { closeApp, openAppThreeDevices, SupportedPlatformsType } from './utils/open_app'; +import { ConversationItem, MessageRequestsBanner } from '../locators/home'; +import { newUser } from '../utils/create_account'; +import { linkedDevice } from '../utils/link_device'; +import { closeApp, openAppThreeDevices, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Accept message request', @@ -34,10 +34,10 @@ async function acceptRequest(platform: SupportedPlatformsType, testInfo: TestInf await device2.clickOnByAccessibilityID('Accept message request'); // Check control message for message request acceptance // "messageRequestsAccepted": "Your message request has been accepted.", - const messageRequestsAccepted = englishStrippedStr('messageRequestsAccepted').toString(); - const messageRequestYouHaveAccepted = englishStrippedStr('messageRequestYouHaveAccepted') - .withArgs({ name: alice.userName }) - .toString(); + const messageRequestsAccepted = tStripped('messageRequestsAccepted'); + const messageRequestYouHaveAccepted = tStripped('messageRequestYouHaveAccepted', { + name: alice.userName, + }); await Promise.all([ device1.waitForControlMessageToBePresent(messageRequestsAccepted), device2.waitForControlMessageToBePresent(messageRequestYouHaveAccepted), diff --git a/run/test/specs/message_requests_accept_text_reply.spec.ts b/run/test/specs/message_requests_accept_text_reply.spec.ts index 525912dd6c..36825d3afc 100644 --- a/run/test/specs/message_requests_accept_text_reply.spec.ts +++ b/run/test/specs/message_requests_accept_text_reply.spec.ts @@ -1,14 +1,14 @@ import type { TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { bothPlatformsIt } from '../../types/sessionIt'; import { USERNAME } from '../../types/testing'; -import { MessageInput, OutgoingMessageStatusSent, SendButton } from './locators/conversation'; -import { PlusButton } from './locators/home'; -import { MessageRequestsBanner } from './locators/home'; -import { EnterAccountID, NewMessageOption, NextButton } from './locators/start_conversation'; -import { newUser } from './utils/create_account'; -import { closeApp, openAppTwoDevices, SupportedPlatformsType } from './utils/open_app'; +import { MessageInput, OutgoingMessageStatusSent, SendButton } from '../locators/conversation'; +import { PlusButton } from '../locators/home'; +import { MessageRequestsBanner } from '../locators/home'; +import { EnterAccountID, NewMessageOption, NextButton } from '../locators/start_conversation'; +import { newUser } from '../utils/create_account'; +import { closeApp, openAppTwoDevices, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Accept message request with text', @@ -36,9 +36,7 @@ async function acceptRequestWithText(platform: SupportedPlatformsType, testInfo: await device1.scrollDown(); await device1.clickOnElementAll(new NextButton(device1)); //messageRequestPendingDescription: "You will be able to send voice messages and attachments once the recipient has approved this message request." - const messageRequestPendingDescription = englishStrippedStr( - 'messageRequestPendingDescription' - ).toString(); + const messageRequestPendingDescription = tStripped('messageRequestPendingDescription'); await device1.onIOS().waitForTextElementToBePresent({ strategy: 'accessibility id', selector: 'Control message', @@ -62,9 +60,7 @@ async function acceptRequestWithText(platform: SupportedPlatformsType, testInfo: await device2.clickOnByAccessibilityID('Message request'); // Check control message warning of sending message request reply // "messageRequestsAcceptDescription": "Sending a message to this user will automatically accept their message request and reveal your Account ID." - const messageRequestsAcceptDescription = englishStrippedStr( - 'messageRequestsAcceptDescription' - ).toString(); + const messageRequestsAcceptDescription = tStripped('messageRequestsAcceptDescription'); await device2.onIOS().waitForControlMessageToBePresent(messageRequestsAcceptDescription); await device2.onAndroid().waitForTextElementToBePresent({ @@ -77,10 +73,10 @@ async function acceptRequestWithText(platform: SupportedPlatformsType, testInfo: await device2.sendMessage(`${bob.userName} to ${alice.userName}`); // Check control message for message request acceptance // "messageRequestsAccepted": "Your message request has been accepted.", - const messageRequestsAccepted = englishStrippedStr('messageRequestsAccepted').toString(); - const messageRequestYouHaveAccepted = englishStrippedStr('messageRequestYouHaveAccepted') - .withArgs({ name: alice.userName }) - .toString(); + const messageRequestsAccepted = tStripped('messageRequestsAccepted'); + const messageRequestYouHaveAccepted = tStripped('messageRequestYouHaveAccepted', { + name: alice.userName, + }); await Promise.all([ device1.waitForControlMessageToBePresent(messageRequestsAccepted), device2.waitForControlMessageToBePresent(messageRequestYouHaveAccepted), diff --git a/run/test/specs/message_requests_block.spec.ts b/run/test/specs/message_requests_block.spec.ts index 8a9399f894..04f0f9ac50 100644 --- a/run/test/specs/message_requests_block.spec.ts +++ b/run/test/specs/message_requests_block.spec.ts @@ -1,16 +1,16 @@ import type { TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { bothPlatformsIt } from '../../types/sessionIt'; import { type AccessibilityId, USERNAME } from '../../types/testing'; -import { BlockedContactsSettings } from './locators'; -import { Contact } from './locators/global'; -import { MessageRequestsBanner, PlusButton } from './locators/home'; -import { ConversationsMenuItem, UserSettings } from './locators/settings'; -import { sleepFor } from './utils'; -import { newUser } from './utils/create_account'; -import { linkedDevice } from './utils/link_device'; -import { closeApp, openAppThreeDevices, SupportedPlatformsType } from './utils/open_app'; +import { BlockedContactsSettings } from '../locators'; +import { Contact } from '../locators/global'; +import { MessageRequestsBanner, PlusButton } from '../locators/home'; +import { ConversationsMenuItem, UserSettings } from '../locators/settings'; +import { sleepFor } from '../utils'; +import { newUser } from '../utils/create_account'; +import { linkedDevice } from '../utils/link_device'; +import { closeApp, openAppThreeDevices, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Block message request in conversation', @@ -41,12 +41,12 @@ async function blockedRequest(platform: SupportedPlatformsType, testInfo: TestIn // Confirm block on android await sleepFor(1000); await device2.checkModalStrings( - englishStrippedStr('block').toString(), - englishStrippedStr('blockDescription').withArgs({ name: alice.userName }).toString() + tStripped('block'), + tStripped('blockDescription', { name: alice.userName }) ); await device2.clickOnByAccessibilityID('Block'); // This is an old Android modal so can't use the modern locator class // "messageRequestsNonePending": "No pending message requests", - const messageRequestsNonePending = englishStrippedStr('messageRequestsNonePending').toString(); + const messageRequestsNonePending = tStripped('messageRequestsNonePending'); await Promise.all([ device2.waitForTextElementToBePresent({ strategy: 'accessibility id', diff --git a/run/test/specs/message_requests_clear_all.spec.ts b/run/test/specs/message_requests_clear_all.spec.ts index 9430278306..dce65e4021 100644 --- a/run/test/specs/message_requests_clear_all.spec.ts +++ b/run/test/specs/message_requests_clear_all.spec.ts @@ -1,11 +1,11 @@ import type { TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { bothPlatformsIt } from '../../types/sessionIt'; import { type AccessibilityId, USERNAME } from '../../types/testing'; -import { MessageRequestsBanner } from './locators/home'; -import { newUser } from './utils/create_account'; -import { closeApp, openAppTwoDevices, SupportedPlatformsType } from './utils/open_app'; +import { MessageRequestsBanner } from '../locators/home'; +import { newUser } from '../utils/create_account'; +import { closeApp, openAppTwoDevices, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Message requests clear all', @@ -28,12 +28,12 @@ async function clearAllRequests(platform: SupportedPlatformsType, testInfo: Test // Select Clear All button await device2.clickOnByAccessibilityID('Clear all'); await device2.checkModalStrings( - englishStrippedStr('clearAll').toString(), - englishStrippedStr('messageRequestsClearAllExplanation').toString() + tStripped('clearAll'), + tStripped('messageRequestsClearAllExplanation') ); await device2.clickOnByAccessibilityID('Clear'); // "messageRequestsNonePending": "No pending message requests", - const messageRequestsNonePending = englishStrippedStr('messageRequestsNonePending').toString(); + const messageRequestsNonePending = tStripped('messageRequestsNonePending'); await device2.waitForTextElementToBePresent({ strategy: 'accessibility id', selector: messageRequestsNonePending as AccessibilityId, diff --git a/run/test/specs/message_requests_decline.spec.ts b/run/test/specs/message_requests_decline.spec.ts index 442a6032d0..65078612fa 100644 --- a/run/test/specs/message_requests_decline.spec.ts +++ b/run/test/specs/message_requests_decline.spec.ts @@ -1,14 +1,14 @@ import type { TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { bothPlatformsIt } from '../../types/sessionIt'; import { type AccessibilityId, USERNAME } from '../../types/testing'; -import { DeclineMessageRequestButton, DeleteMesssageRequestConfirmation } from './locators'; -import { MessageRequestItem, MessageRequestsBanner, PlusButton } from './locators/home'; -import { sleepFor } from './utils'; -import { newUser } from './utils/create_account'; -import { linkedDevice } from './utils/link_device'; -import { closeApp, openAppThreeDevices, SupportedPlatformsType } from './utils/open_app'; +import { DeclineMessageRequestButton, DeleteMesssageRequestConfirmation } from '../locators'; +import { MessageRequestItem, MessageRequestsBanner, PlusButton } from '../locators/home'; +import { sleepFor } from '../utils'; +import { newUser } from '../utils/create_account'; +import { linkedDevice } from '../utils/link_device'; +import { closeApp, openAppThreeDevices, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Delete message request in conversation', @@ -35,13 +35,10 @@ async function declineRequest(platform: SupportedPlatformsType, testInfo: TestIn await device3.waitForTextElementToBePresent(new MessageRequestItem(device3)); // Click on decline button await device2.clickOnElementAll(new DeclineMessageRequestButton(device2)); - await device2.checkModalStrings( - englishStrippedStr('delete').toString(), - englishStrippedStr('messageRequestsContactDelete').toString() - ); + await device2.checkModalStrings(tStripped('delete'), tStripped('messageRequestsContactDelete')); await device2.clickOnElementAll(new DeleteMesssageRequestConfirmation(device2)); // "messageRequestsNonePending": "No pending message requests", - const messageRequestsNonePending = englishStrippedStr('messageRequestsNonePending').toString(); + const messageRequestsNonePending = tStripped('messageRequestsNonePending'); await Promise.all([ device2.waitForTextElementToBePresent({ strategy: 'accessibility id', diff --git a/run/test/specs/message_requests_delete.spec.ts b/run/test/specs/message_requests_delete.spec.ts index a67a40d35f..6657a57cac 100644 --- a/run/test/specs/message_requests_delete.spec.ts +++ b/run/test/specs/message_requests_delete.spec.ts @@ -1,12 +1,12 @@ import type { TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { bothPlatformsIt } from '../../types/sessionIt'; import { type AccessibilityId, USERNAME } from '../../types/testing'; -import { DeleteMessageRequestButton, DeleteMesssageRequestConfirmation } from './locators'; -import { MessageRequestItem, MessageRequestsBanner } from './locators/home'; -import { newUser } from './utils/create_account'; -import { closeApp, openAppTwoDevices, SupportedPlatformsType } from './utils/open_app'; +import { DeleteMessageRequestButton, DeleteMesssageRequestConfirmation } from '../locators'; +import { MessageRequestItem, MessageRequestsBanner } from '../locators/home'; +import { newUser } from '../utils/create_account'; +import { closeApp, openAppTwoDevices, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Delete message request in list', @@ -30,13 +30,10 @@ async function deleteRequest(platform: SupportedPlatformsType, testInfo: TestInf await device2.onIOS().swipeLeftAny('Message request'); await device2.onAndroid().longPress(new MessageRequestItem(device2)); await device2.clickOnElementAll(new DeleteMessageRequestButton(device2)); - await device2.checkModalStrings( - englishStrippedStr('delete').toString(), - englishStrippedStr('messageRequestsContactDelete').toString() - ); + await device2.checkModalStrings(tStripped('delete'), tStripped('messageRequestsContactDelete')); await device2.clickOnElementAll(new DeleteMesssageRequestConfirmation(device2)); // "messageRequestsNonePending": "No pending message requests", - const messageRequestsNonePending = englishStrippedStr('messageRequestsNonePending').toString(); + const messageRequestsNonePending = tStripped('messageRequestsNonePending'); await device2.waitForTextElementToBePresent({ strategy: 'accessibility id', selector: messageRequestsNonePending as AccessibilityId, diff --git a/run/test/specs/message_unsend.spec.ts b/run/test/specs/message_unsend.spec.ts index a7ef191cde..92a4b3c5c9 100644 --- a/run/test/specs/message_unsend.spec.ts +++ b/run/test/specs/message_unsend.spec.ts @@ -1,11 +1,11 @@ import type { TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { bothPlatformsIt } from '../../types/sessionIt'; -import { DeleteMessageConfirmationModal, DeleteMessageForEveryone } from './locators'; -import { DeletedMessage, MessageBody } from './locators/conversation'; -import { open_Alice1_Bob1_friends } from './state_builder'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +import { DeleteMessageConfirmationModal, DeleteMessageForEveryone } from '../locators'; +import { DeletedMessage, MessageBody } from '../locators/conversation'; +import { open_Alice1_Bob1_friends } from '../state_builder'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Unsend message', @@ -34,8 +34,8 @@ async function unsendMessage(platform: SupportedPlatformsType, testInfo: TestInf // Check modal is correct // Check modal is correct await alice1.checkModalStrings( - englishStrippedStr('deleteMessage').withArgs({ count: 1 }).toString(), - englishStrippedStr('deleteMessageConfirm').withArgs({ count: 1 }).toString() + tStripped('deleteMessage', { count: 1 }), + tStripped('deleteMessageConfirm', { count: 1 }) ); // Select 'Delete for me and User B' await alice1.clickOnElementAll(new DeleteMessageForEveryone(alice1)); diff --git a/run/test/specs/message_video.spec.ts b/run/test/specs/message_video.spec.ts index 191943cbca..469e8414b8 100644 --- a/run/test/specs/message_video.spec.ts +++ b/run/test/specs/message_video.spec.ts @@ -1,10 +1,10 @@ import type { TestInfo } from '@playwright/test'; import { bothPlatformsItSeparate } from '../../types/sessionIt'; -import { MediaMessage, MessageBody } from './locators/conversation'; -import { open_Alice1_Bob1_friends } from './state_builder'; -import { sleepFor } from './utils'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +import { MediaMessage, MessageBody } from '../locators/conversation'; +import { open_Alice1_Bob1_friends } from '../state_builder'; +import { sleepFor } from '../utils'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsItSeparate({ title: 'Send video 1:1', diff --git a/run/test/specs/message_voice.spec.ts b/run/test/specs/message_voice.spec.ts index 8b104972b6..e5802e79de 100644 --- a/run/test/specs/message_voice.spec.ts +++ b/run/test/specs/message_voice.spec.ts @@ -1,10 +1,10 @@ import type { TestInfo } from '@playwright/test'; import { bothPlatformsIt } from '../../types/sessionIt'; -import { MessageBody, VoiceMessage } from './locators/conversation'; -import { open_Alice1_Bob1_friends } from './state_builder'; -import { sleepFor } from './utils'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +import { MessageBody, VoiceMessage } from '../locators/conversation'; +import { open_Alice1_Bob1_friends } from '../state_builder'; +import { sleepFor } from '../utils'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Send voice message 1:1', diff --git a/run/test/specs/network_page_link_network.spec.ts b/run/test/specs/network_page_link_network.spec.ts index 574cadf806..ef4c162b7d 100644 --- a/run/test/specs/network_page_link_network.spec.ts +++ b/run/test/specs/network_page_link_network.spec.ts @@ -1,19 +1,19 @@ import type { TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { bothPlatformsIt } from '../../types/sessionIt'; import { USERNAME } from '../../types/testing'; -import { SafariAddressBar, URLInputField } from './locators/browsers'; +import { SafariAddressBar, URLInputField } from '../locators/browsers'; import { OpenLinkButton, SessionNetworkLearnMoreNetwork, SessionNetworkMenuItem, -} from './locators/network_page'; -import { UserSettings } from './locators/settings'; -import { newUser } from './utils/create_account'; -import { handleChromeFirstTimeOpen } from './utils/handle_first_open'; -import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from './utils/open_app'; -import { assertUrlIsReachable, ensureHttpsURL } from './utils/utilities'; +} from '../locators/network_page'; +import { UserSettings } from '../locators/settings'; +import { newUser } from '../utils/create_account'; +import { handleChromeFirstTimeOpen } from '../utils/handle_first_open'; +import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from '../utils/open_app'; +import { assertUrlIsReachable, ensureHttpsURL } from '../utils/utilities'; bothPlatformsIt({ title: 'Network page learn more network link', @@ -36,8 +36,8 @@ async function networkPageLearnMore(platform: SupportedPlatformsType, testInfo: await device.clickOnElementAll(new SessionNetworkMenuItem(device)); await device.clickOnElementAll(new SessionNetworkLearnMoreNetwork(device)); await device.checkModalStrings( - englishStrippedStr('urlOpen').toString(), - englishStrippedStr('urlOpenDescription').withArgs({ url: linkURL }).toString() + tStripped('urlOpen'), + tStripped('urlOpenDescription', { url: linkURL }) ); await device.clickOnElementAll(new OpenLinkButton(device)); if (platform === 'ios') { diff --git a/run/test/specs/network_page_link_staking.spec.ts b/run/test/specs/network_page_link_staking.spec.ts index 114dcc2bfa..aa7e574595 100644 --- a/run/test/specs/network_page_link_staking.spec.ts +++ b/run/test/specs/network_page_link_staking.spec.ts @@ -1,19 +1,19 @@ import type { TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { bothPlatformsIt } from '../../types/sessionIt'; import { USERNAME } from '../../types/testing'; -import { SafariAddressBar, URLInputField } from './locators/browsers'; +import { SafariAddressBar, URLInputField } from '../locators/browsers'; import { OpenLinkButton, SessionNetworkLearnMoreStaking, SessionNetworkMenuItem, -} from './locators/network_page'; -import { UserSettings } from './locators/settings'; -import { newUser } from './utils/create_account'; -import { handleChromeFirstTimeOpen } from './utils/handle_first_open'; -import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from './utils/open_app'; -import { assertUrlIsReachable, ensureHttpsURL } from './utils/utilities'; +} from '../locators/network_page'; +import { UserSettings } from '../locators/settings'; +import { newUser } from '../utils/create_account'; +import { handleChromeFirstTimeOpen } from '../utils/handle_first_open'; +import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from '../utils/open_app'; +import { assertUrlIsReachable, ensureHttpsURL } from '../utils/utilities'; bothPlatformsIt({ title: 'Network page learn more staking link', @@ -36,8 +36,8 @@ async function networkPageLearnMore(platform: SupportedPlatformsType, testInfo: await device.clickOnElementAll(new SessionNetworkMenuItem(device)); await device.clickOnElementAll(new SessionNetworkLearnMoreStaking(device)); await device.checkModalStrings( - englishStrippedStr('urlOpen').toString(), - englishStrippedStr('urlOpenDescription').withArgs({ url: linkURL }).toString() + tStripped('urlOpen'), + tStripped('urlOpenDescription', { url: linkURL }) ); await device.clickOnElementAll(new OpenLinkButton(device)); if (platform === 'ios') { diff --git a/run/test/specs/network_page_refresh_page.spec.ts b/run/test/specs/network_page_refresh_page.spec.ts index f8c4ca667b..64c2173ec2 100644 --- a/run/test/specs/network_page_refresh_page.spec.ts +++ b/run/test/specs/network_page_refresh_page.spec.ts @@ -2,11 +2,11 @@ import type { TestInfo } from '@playwright/test'; import { bothPlatformsIt } from '../../types/sessionIt'; import { USERNAME } from '../../types/testing'; -import { LastUpdatedTimeStamp, SessionNetworkMenuItem } from './locators/network_page'; -import { UserSettings } from './locators/settings'; -import { sleepFor } from './utils'; -import { newUser } from './utils/create_account'; -import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from './utils/open_app'; +import { LastUpdatedTimeStamp, SessionNetworkMenuItem } from '../locators/network_page'; +import { UserSettings } from '../locators/settings'; +import { sleepFor } from '../utils'; +import { newUser } from '../utils/create_account'; +import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Network page refresh', diff --git a/run/test/specs/network_page_values.spec.ts b/run/test/specs/network_page_values.spec.ts index e8558cb5c7..61643ff9ba 100644 --- a/run/test/specs/network_page_values.spec.ts +++ b/run/test/specs/network_page_values.spec.ts @@ -8,11 +8,11 @@ import { SESHPrice, SessionNetworkMenuItem, StakingRewardPoolAmount, -} from './locators/network_page'; -import { UserSettings } from './locators/settings'; -import { newUser } from './utils/create_account'; -import { validateNetworkData } from './utils/network_api'; -import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from './utils/open_app'; +} from '../locators/network_page'; +import { UserSettings } from '../locators/settings'; +import { newUser } from '../utils/create_account'; +import { validateNetworkData } from '../utils/network_api'; +import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Network page values', diff --git a/run/test/specs/input_validations/onboarding_incorrect_seed.spec.ts b/run/test/specs/onboarding_incorrect_seed.spec.ts similarity index 88% rename from run/test/specs/input_validations/onboarding_incorrect_seed.spec.ts rename to run/test/specs/onboarding_incorrect_seed.spec.ts index ae8140d4e2..a6b3b982a9 100644 --- a/run/test/specs/input_validations/onboarding_incorrect_seed.spec.ts +++ b/run/test/specs/onboarding_incorrect_seed.spec.ts @@ -1,7 +1,7 @@ import type { TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../../localizer/englishStrippedStr'; -import { bothPlatformsIt } from '../../../types/sessionIt'; +import { tStripped } from '../../localizer/lib'; +import { bothPlatformsIt } from '../../types/sessionIt'; import { ContinueButton } from '../locators/global'; import { AccountRestoreButton, ErrorMessage, SeedPhraseInput } from '../locators/onboarding'; import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from '../utils/open_app'; @@ -25,7 +25,7 @@ async function onboardingIncorrectSeed(platform: SupportedPlatformsType, testInf const incorrectSeed = 'ruby bakery illness push rift reef nabbing bawled hope zork silk lobster hope'; // the expected error is 'Some words are incorrect' which is represented by the following localized string - const expectedError = englishStrippedStr('recoveryPasswordErrorMessageIncorrect').toString(); + const expectedError = tStripped('recoveryPasswordErrorMessageIncorrect'); await device.inputText(incorrectSeed, new SeedPhraseInput(device)); // Trigger the validation by pressing Continue await device.clickOnElementAll(new ContinueButton(device)); diff --git a/run/test/specs/input_validations/onboarding_long_name.spec.ts b/run/test/specs/onboarding_long_name.spec.ts similarity index 90% rename from run/test/specs/input_validations/onboarding_long_name.spec.ts rename to run/test/specs/onboarding_long_name.spec.ts index afbc62d161..b362df9e46 100644 --- a/run/test/specs/input_validations/onboarding_long_name.spec.ts +++ b/run/test/specs/onboarding_long_name.spec.ts @@ -1,7 +1,7 @@ import type { TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../../localizer/englishStrippedStr'; -import { bothPlatformsIt } from '../../../types/sessionIt'; +import { tStripped } from '../../localizer/lib'; +import { bothPlatformsIt } from '../../types/sessionIt'; import { ContinueButton } from '../locators/global'; import { CreateAccountButton, DisplayNameInput, ErrorMessage } from '../locators/onboarding'; import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from '../utils/open_app'; @@ -24,7 +24,7 @@ async function onboardingLongName(platform: SupportedPlatformsType, testInfo: Te const tooLongName = 'One morning, when Gregor Samsa woke from troubled dreams, he found himself transformed in his bed int'; // the expected error is 'Please enter a shorter display name' which is represented by the following localized string - const expectedError = englishStrippedStr('displayNameErrorDescriptionShorter').toString(); + const expectedError = tStripped('displayNameErrorDescriptionShorter'); await device.clickOnElementAll(new CreateAccountButton(device)); // this check is to avoid false positives if (tooLongName.length <= 100) { diff --git a/run/test/specs/input_validations/onboarding_no_name.spec.ts b/run/test/specs/onboarding_no_name.spec.ts similarity index 88% rename from run/test/specs/input_validations/onboarding_no_name.spec.ts rename to run/test/specs/onboarding_no_name.spec.ts index 0e6010670d..96b02082c5 100644 --- a/run/test/specs/input_validations/onboarding_no_name.spec.ts +++ b/run/test/specs/onboarding_no_name.spec.ts @@ -1,7 +1,7 @@ import type { TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../../localizer/englishStrippedStr'; -import { bothPlatformsIt } from '../../../types/sessionIt'; +import { tStripped } from '../../localizer/lib'; +import { bothPlatformsIt } from '../../types/sessionIt'; import { ContinueButton } from '../locators/global'; import { CreateAccountButton, DisplayNameInput, ErrorMessage } from '../locators/onboarding'; import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from '../utils/open_app'; @@ -22,7 +22,7 @@ async function onboardingNoName(platform: SupportedPlatformsType, testInfo: Test const { device } = await openAppOnPlatformSingleDevice(platform, testInfo); await device.clickOnElementAll(new CreateAccountButton(device)); // the expected error is 'Please enter a display name' which is represented by the following localized string - const expectedError = englishStrippedStr('displayNameErrorDescription').toString(); + const expectedError = tStripped('displayNameErrorDescription'); const emptyName = ''; // this check is to avoid false positives if (emptyName.length > 0) { diff --git a/run/test/specs/input_validations/onboarding_no_seed.spec.ts b/run/test/specs/onboarding_no_seed.spec.ts similarity index 88% rename from run/test/specs/input_validations/onboarding_no_seed.spec.ts rename to run/test/specs/onboarding_no_seed.spec.ts index 0fc3ae064c..2ce8f0b644 100644 --- a/run/test/specs/input_validations/onboarding_no_seed.spec.ts +++ b/run/test/specs/onboarding_no_seed.spec.ts @@ -1,7 +1,7 @@ import type { TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../../localizer/englishStrippedStr'; -import { bothPlatformsIt } from '../../../types/sessionIt'; +import { tStripped } from '../../localizer/lib'; +import { bothPlatformsIt } from '../../types/sessionIt'; import { ContinueButton } from '../locators/global'; import { AccountRestoreButton, ErrorMessage, SeedPhraseInput } from '../locators/onboarding'; import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from '../utils/open_app'; @@ -23,7 +23,7 @@ async function onboardingNoSeed(platform: SupportedPlatformsType, testInfo: Test await device.clickOnElementAll(new AccountRestoreButton(device)); const emptySeed = ''; // the expected error is 'Recovery Password not long enough' which is represented by the following localized string - const expectedError = englishStrippedStr('recoveryPasswordErrorMessageShort').toString(); + const expectedError = tStripped('recoveryPasswordErrorMessageShort'); // this check is to avoid false positives if (emptySeed.length > 0) { throw new Error('The emptySeed string is not empty but it must be.'); diff --git a/run/test/specs/onboarding_pp.spec.ts b/run/test/specs/onboarding_pp.spec.ts index ba8192817d..9812fc4cf3 100644 --- a/run/test/specs/onboarding_pp.spec.ts +++ b/run/test/specs/onboarding_pp.spec.ts @@ -1,11 +1,11 @@ import type { TestInfo } from '@playwright/test'; import { bothPlatformsIt } from '../../types/sessionIt'; -import { SafariAddressBar, URLInputField } from './locators/browsers'; -import { PrivacyPolicyButton, SplashScreenLinks } from './locators/onboarding'; -import { handleChromeFirstTimeOpen } from './utils/handle_first_open'; -import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from './utils/open_app'; -import { assertUrlIsReachable, ensureHttpsURL } from './utils/utilities'; +import { SafariAddressBar, URLInputField } from '../locators/browsers'; +import { PrivacyPolicyButton, SplashScreenLinks } from '../locators/onboarding'; +import { handleChromeFirstTimeOpen } from '../utils/handle_first_open'; +import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from '../utils/open_app'; +import { assertUrlIsReachable, ensureHttpsURL } from '../utils/utilities'; bothPlatformsIt({ title: 'Onboarding privacy policy', diff --git a/run/test/specs/onboarding_tos.spec.ts b/run/test/specs/onboarding_tos.spec.ts index 37ba46013d..933b78a47d 100644 --- a/run/test/specs/onboarding_tos.spec.ts +++ b/run/test/specs/onboarding_tos.spec.ts @@ -1,11 +1,11 @@ import type { TestInfo } from '@playwright/test'; import { bothPlatformsIt } from '../../types/sessionIt'; -import { SafariAddressBar, URLInputField } from './locators/browsers'; -import { SplashScreenLinks, TermsOfServiceButton } from './locators/onboarding'; -import { handleChromeFirstTimeOpen } from './utils/handle_first_open'; -import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from './utils/open_app'; -import { assertUrlIsReachable, ensureHttpsURL } from './utils/utilities'; +import { SafariAddressBar, URLInputField } from '../locators/browsers'; +import { SplashScreenLinks, TermsOfServiceButton } from '../locators/onboarding'; +import { handleChromeFirstTimeOpen } from '../utils/handle_first_open'; +import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from '../utils/open_app'; +import { assertUrlIsReachable, ensureHttpsURL } from '../utils/utilities'; bothPlatformsIt({ title: 'Onboarding terms of service', diff --git a/run/test/specs/input_validations/onboarding_wrong_seed.spec.ts b/run/test/specs/onboarding_wrong_seed.spec.ts similarity index 88% rename from run/test/specs/input_validations/onboarding_wrong_seed.spec.ts rename to run/test/specs/onboarding_wrong_seed.spec.ts index 8d4ee3bc60..001266f06f 100644 --- a/run/test/specs/input_validations/onboarding_wrong_seed.spec.ts +++ b/run/test/specs/onboarding_wrong_seed.spec.ts @@ -1,7 +1,7 @@ import type { TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../../localizer/englishStrippedStr'; -import { bothPlatformsIt } from '../../../types/sessionIt'; +import { tStripped } from '../../localizer/lib'; +import { bothPlatformsIt } from '../../types/sessionIt'; import { ContinueButton } from '../locators/global'; import { AccountRestoreButton, ErrorMessage, SeedPhraseInput } from '../locators/onboarding'; import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from '../utils/open_app'; @@ -24,7 +24,7 @@ async function onboardingIncorrectSeed(platform: SupportedPlatformsType, testInf const wrongSeed = 'ruby bakery illness push rift reef nabbing bawled hope ruby silk lobster hope ruby ruby ruby'; // the expected error is 'Please check your recovery password' which is represented by the following localized string - const expectedError = englishStrippedStr('recoveryPasswordErrorMessageGeneric').toString(); + const expectedError = tStripped('recoveryPasswordErrorMessageGeneric'); await device.clickOnElementAll(new AccountRestoreButton(device)); await device.inputText(wrongSeed, new SeedPhraseInput(device)); // Trigger the validation by pressing Continue diff --git a/run/test/specs/ons_resolve.spec.ts b/run/test/specs/ons_resolve.spec.ts index b22edcb2b5..16ec3d18b3 100644 --- a/run/test/specs/ons_resolve.spec.ts +++ b/run/test/specs/ons_resolve.spec.ts @@ -4,12 +4,12 @@ import { ONS_MAPPINGS } from '../../constants'; import { TestSteps } from '../../types/allure'; import { bothPlatformsIt } from '../../types/sessionIt'; import { USERNAME } from '../../types/testing'; -import { ConversationHeaderName } from './locators/conversation'; -import { PlusButton } from './locators/home'; -import { EnterAccountID, NewMessageOption, NextButton } from './locators/start_conversation'; -import { newUser } from './utils/create_account'; -import { truncatePubkey } from './utils/get_account_id'; -import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from './utils/open_app'; +import { ConversationHeaderName } from '../locators/conversation'; +import { PlusButton } from '../locators/home'; +import { EnterAccountID, NewMessageOption, NextButton } from '../locators/start_conversation'; +import { newUser } from '../utils/create_account'; +import { truncatePubkey } from '../utils/get_account_id'; +import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'ONS resolution', diff --git a/run/test/specs/review_negative.spec.ts b/run/test/specs/review_negative.spec.ts index 63c6c88fc0..91364f2648 100644 --- a/run/test/specs/review_negative.spec.ts +++ b/run/test/specs/review_negative.spec.ts @@ -1,6 +1,6 @@ import { test, type TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { TestSteps } from '../../types/allure'; import { bothPlatformsIt } from '../../types/sessionIt'; import { USERNAME } from '../../types/testing'; @@ -8,11 +8,11 @@ import { ReviewPromptNeedsWorkButton, ReviewPromptNotNowButton, ReviewPromptOpenSurveyButton, -} from './locators/home'; -import { PathMenuItem } from './locators/settings'; -import { newUser } from './utils/create_account'; -import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from './utils/open_app'; -import { assertUrlIsReachable } from './utils/utilities'; +} from '../locators/home'; +import { PathMenuItem } from '../locators/settings'; +import { newUser } from '../utils/create_account'; +import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from '../utils/open_app'; +import { assertUrlIsReachable } from '../utils/utilities'; bothPlatformsIt({ title: 'Review prompt negative flow', @@ -45,24 +45,18 @@ async function reviewPromptNegative(platform: SupportedPlatformsType, testInfo: }); await test.step(TestSteps.VERIFY.SPECIFIC_MODAL('Enjoying Session'), async () => { await device.checkModalStrings( - englishStrippedStr('enjoyingSession').toString(), - englishStrippedStr('enjoyingSessionDescription').toString() + tStripped('enjoyingSession'), + tStripped('enjoyingSessionDescription') ); await device.clickOnElementAll(new ReviewPromptNeedsWorkButton(device)); }); await test.step(TestSteps.VERIFY.SPECIFIC_MODAL('Give Feedback'), async () => { - await device.checkModalStrings( - englishStrippedStr('giveFeedback').toString(), - englishStrippedStr('giveFeedbackDescription').toString() - ); + await device.checkModalStrings(tStripped('giveFeedback'), tStripped('giveFeedbackDescription')); await device.waitForTextElementToBePresent(new ReviewPromptNotNowButton(device)); await device.clickOnElementAll(new ReviewPromptOpenSurveyButton(device)); }); await test.step(TestSteps.VERIFY.SPECIFIC_MODAL('Open URL'), async () => { - await device.checkModalStrings( - englishStrippedStr('urlOpen').toString(), - englishStrippedStr('urlOpenDescription').withArgs({ url }).toString() - ); + await device.checkModalStrings(tStripped('urlOpen'), tStripped('urlOpenDescription', { url })); await assertUrlIsReachable(url); }); await test.step(TestSteps.SETUP.CLOSE_APP, async () => { diff --git a/run/test/specs/review_once.spec.ts b/run/test/specs/review_once.spec.ts index e909041650..584286a2a6 100644 --- a/run/test/specs/review_once.spec.ts +++ b/run/test/specs/review_once.spec.ts @@ -1,15 +1,15 @@ import { test, type TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { TestSteps } from '../../types/allure'; import { bothPlatformsIt } from '../../types/sessionIt'; import { USERNAME } from '../../types/testing'; -import { CloseSettings } from './locators'; -import { ModalHeading } from './locators/global'; -import { PlusButton } from './locators/home'; -import { PathMenuItem, UserSettings } from './locators/settings'; -import { newUser } from './utils/create_account'; -import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from './utils/open_app'; +import { CloseSettings } from '../locators'; +import { ModalHeading } from '../locators/global'; +import { PlusButton } from '../locators/home'; +import { PathMenuItem, UserSettings } from '../locators/settings'; +import { newUser } from '../utils/create_account'; +import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Review prompt only once', @@ -37,8 +37,8 @@ async function reviewPromptOnce(platform: SupportedPlatformsType, testInfo: Test }); await test.step(TestSteps.VERIFY.GENERIC_MODAL, async () => { await device.checkModalStrings( - englishStrippedStr('enjoyingSession').toString(), - englishStrippedStr('enjoyingSessionDescription').toString() + tStripped('enjoyingSession'), + tStripped('enjoyingSessionDescription') ); await device.clickOnElementAll(new CloseSettings(device)); }); diff --git a/run/test/specs/review_positive.spec.ts b/run/test/specs/review_positive.spec.ts index 6a003e20b5..86a8ff2687 100644 --- a/run/test/specs/review_positive.spec.ts +++ b/run/test/specs/review_positive.spec.ts @@ -1,6 +1,6 @@ import { test, type TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { TestSteps } from '../../types/allure'; import { bothPlatformsIt } from '../../types/sessionIt'; import { USERNAME } from '../../types/testing'; @@ -8,10 +8,10 @@ import { ReviewPromptItsGreatButton, ReviewPromptNotNowButton, ReviewPromptRateAppButton, -} from './locators/home'; -import { PathMenuItem, UserSettings } from './locators/settings'; -import { newUser } from './utils/create_account'; -import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from './utils/open_app'; +} from '../locators/home'; +import { PathMenuItem, UserSettings } from '../locators/settings'; +import { newUser } from '../utils/create_account'; +import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Review prompt positive flow', @@ -31,10 +31,8 @@ async function reviewPromptPositive(platform: SupportedPlatformsType, testInfo: // Platform specific string for the Rate Session modal const rateModalDescriptionString = platform === 'android' - ? englishStrippedStr('rateSessionModalDescription').withArgs({ storevariant }).toString() - : englishStrippedStr('rateSessionModalDescriptionUpdated') - .withArgs({ storevariant }) - .toString(); + ? tStripped('rateSessionModalDescription', { storevariant }) + : tStripped('rateSessionModalDescriptionUpdated', { storevariant }); const { device } = await test.step(TestSteps.SETUP.NEW_USER, async () => { const { device } = await openAppOnPlatformSingleDevice(platform, testInfo); await newUser(device, USERNAME.ALICE, { saveUserData: false }); @@ -48,16 +46,13 @@ async function reviewPromptPositive(platform: SupportedPlatformsType, testInfo: }); await test.step(TestSteps.VERIFY.SPECIFIC_MODAL('Enjoying Session'), async () => { await device.checkModalStrings( - englishStrippedStr('enjoyingSession').toString(), - englishStrippedStr('enjoyingSessionDescription').toString() + tStripped('enjoyingSession'), + tStripped('enjoyingSessionDescription') ); await device.clickOnElementAll(new ReviewPromptItsGreatButton(device)); }); await test.step(TestSteps.VERIFY.SPECIFIC_MODAL('Rate Session'), async () => { - await device.checkModalStrings( - englishStrippedStr('rateSession').toString(), - rateModalDescriptionString - ); + await device.checkModalStrings(tStripped('rateSession'), rateModalDescriptionString); await device.waitForTextElementToBePresent(new ReviewPromptRateAppButton(device)); await device.onAndroid().waitForTextElementToBePresent(new ReviewPromptNotNowButton(device)); // On iOS the modal only has the Rate button }); diff --git a/run/test/specs/review_triggers.spec.ts b/run/test/specs/review_triggers.spec.ts index b19e910222..884e6b53c9 100644 --- a/run/test/specs/review_triggers.spec.ts +++ b/run/test/specs/review_triggers.spec.ts @@ -1,20 +1,20 @@ import { test, type TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { TestSteps } from '../../types/allure'; import { DeviceWrapper } from '../../types/DeviceWrapper'; import { bothPlatformsIt } from '../../types/sessionIt'; import { USERNAME } from '../../types/testing'; -import { CopyURLButton } from './locators/global'; +import { CopyURLButton } from '../locators/global'; import { AppearanceMenuItem, ClassicLightThemeOption, DonationsMenuItem, PathMenuItem, UserSettings, -} from './locators/settings'; -import { newUser } from './utils/create_account'; -import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from './utils/open_app'; +} from '../locators/settings'; +import { newUser } from '../utils/create_account'; +import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from '../utils/open_app'; // Yes, multiple tests in one file! const reviewTriggers = [ @@ -75,8 +75,8 @@ for (const { titleSnippet, descriptionSnippet, testStepName, trigger } of review }); await test.step(TestSteps.VERIFY.SPECIFIC_MODAL('App Review'), async () => { await device.checkModalStrings( - englishStrippedStr('enjoyingSession').toString(), - englishStrippedStr('enjoyingSessionDescription').toString() + tStripped('enjoyingSession'), + tStripped('enjoyingSessionDescription') ); }); await test.step(TestSteps.SETUP.CLOSE_APP, async () => { diff --git a/run/test/specs/upm_homescreen.spec.ts b/run/test/specs/upm_homescreen.spec.ts index ce36da7b50..1ef5c7ee65 100644 --- a/run/test/specs/upm_homescreen.spec.ts +++ b/run/test/specs/upm_homescreen.spec.ts @@ -2,9 +2,9 @@ import { test, type TestInfo } from '@playwright/test'; import { TestSteps } from '../../types/allure'; import { androidIt } from '../../types/sessionIt'; -import { open_Alice1_Bob1_friends } from './state_builder'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; -import { verifyPageScreenshot } from './utils/verify_screenshots'; +import { open_Alice1_Bob1_friends } from '../state_builder'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; +import { verifyPageScreenshot } from '../utils/verify_screenshots'; androidIt({ title: 'User Profile Modal Home Screen', diff --git a/run/test/specs/user_actions_block_conversation_list.spec.ts b/run/test/specs/user_actions_block_conversation_list.spec.ts index b0134878d3..0595637c70 100644 --- a/run/test/specs/user_actions_block_conversation_list.spec.ts +++ b/run/test/specs/user_actions_block_conversation_list.spec.ts @@ -1,14 +1,14 @@ import type { TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { androidIt } from '../../types/sessionIt'; import { USERNAME } from '../../types/testing'; -import { BlockedContactsSettings } from './locators'; -import { Contact } from './locators/global'; -import { ConversationItem, LongPressBlockOption } from './locators/home'; -import { ConversationsMenuItem, UserSettings } from './locators/settings'; -import { open_Alice1_Bob1_friends } from './state_builder'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +import { BlockedContactsSettings } from '../locators'; +import { Contact } from '../locators/global'; +import { ConversationItem, LongPressBlockOption } from '../locators/home'; +import { ConversationsMenuItem, UserSettings } from '../locators/settings'; +import { open_Alice1_Bob1_friends } from '../state_builder'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; // Block option no longer available on iOS in conversation list androidIt({ @@ -37,8 +37,8 @@ async function blockUserInConversationList(platform: SupportedPlatformsType, tes await alice1.longPressConversation(bob.userName); await alice1.clickOnElementAll(new LongPressBlockOption(alice1)); await alice1.checkModalStrings( - englishStrippedStr('block').toString(), - englishStrippedStr('blockDescription').withArgs({ name: USERNAME.BOB }).toString() + tStripped('block'), + tStripped('blockDescription', { name: USERNAME.BOB }) ); await alice1.clickOnByAccessibilityID('Block'); // Once you block the conversation disappears from the home screen diff --git a/run/test/specs/user_actions_block_conversation_options.spec.ts b/run/test/specs/user_actions_block_conversation_options.spec.ts index 0c44cd58d2..41c17d851c 100644 --- a/run/test/specs/user_actions_block_conversation_options.spec.ts +++ b/run/test/specs/user_actions_block_conversation_options.spec.ts @@ -1,19 +1,19 @@ import type { TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { bothPlatformsIt } from '../../types/sessionIt'; import { BlockedContactsSettings, BlockUser, BlockUserConfirmationModal, CloseSettings, -} from './locators'; -import { BlockedBanner, ConversationSettings, MessageBody } from './locators/conversation'; -import { Contact } from './locators/global'; -import { ConversationsMenuItem, UserSettings } from './locators/settings'; -import { open_Alice1_Bob1_friends } from './state_builder'; -import { sleepFor } from './utils'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +} from '../locators'; +import { BlockedBanner, ConversationSettings, MessageBody } from '../locators/conversation'; +import { Contact } from '../locators/global'; +import { ConversationsMenuItem, UserSettings } from '../locators/settings'; +import { open_Alice1_Bob1_friends } from '../state_builder'; +import { sleepFor } from '../utils'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Block user in conversation settings', @@ -47,8 +47,8 @@ async function blockUserInConversationSettings( await alice1.clickOnElementAll(new BlockUser(alice1)); // Check modal strings await alice1.checkModalStrings( - englishStrippedStr('block').toString(), - englishStrippedStr('blockDescription').withArgs({ name: bob.userName }).toString() + tStripped('block'), + tStripped('blockDescription', { name: bob.userName }) ); // Confirm block option await alice1.clickOnElementAll(new BlockUserConfirmationModal(alice1)); diff --git a/run/test/specs/user_actions_change_profile_picture.spec.ts b/run/test/specs/user_actions_change_profile_picture.spec.ts index 5c3ed7c590..cf3fefafac 100644 --- a/run/test/specs/user_actions_change_profile_picture.spec.ts +++ b/run/test/specs/user_actions_change_profile_picture.spec.ts @@ -3,9 +3,9 @@ import { test, type TestInfo } from '@playwright/test'; import { TestSteps } from '../../types/allure'; import { bothPlatformsIt } from '../../types/sessionIt'; import { USERNAME } from '../../types/testing'; -import { UserAvatar } from './locators/settings'; -import { newUser } from './utils/create_account'; -import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from './utils/open_app'; +import { UserAvatar } from '../locators/settings'; +import { newUser } from '../utils/create_account'; +import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Change profile picture', diff --git a/run/test/specs/user_actions_change_username.spec.ts b/run/test/specs/user_actions_change_username.spec.ts index 0401da51d1..0a242b6288 100644 --- a/run/test/specs/user_actions_change_username.spec.ts +++ b/run/test/specs/user_actions_change_username.spec.ts @@ -1,12 +1,12 @@ import type { TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { bothPlatformsIt } from '../../types/sessionIt'; import { USERNAME } from '../../types/testing'; -import { ClearInputButton, EditUsernameButton, UsernameDisplay, UsernameInput } from './locators'; -import { SaveNameChangeButton, UserSettings } from './locators/settings'; -import { newUser } from './utils/create_account'; -import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from './utils/open_app'; +import { ClearInputButton, EditUsernameButton, UsernameDisplay, UsernameInput } from '../locators'; +import { SaveNameChangeButton, UserSettings } from '../locators/settings'; +import { newUser } from '../utils/create_account'; +import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Change username', @@ -26,10 +26,7 @@ async function changeUsername(platform: SupportedPlatformsType, testInfo: TestIn await device.clickOnElementAll(new UserSettings(device)); // select username await device.clickOnElementAll(new EditUsernameButton(device)); - await device.checkModalStrings( - englishStrippedStr('displayNameSet').toString(), - englishStrippedStr('displayNameVisible').toString() - ); + await device.checkModalStrings(tStripped('displayNameSet'), tStripped('displayNameVisible')); await device.onIOS().deleteText(new UsernameInput(device)); await device.onAndroid().clickOnElementAll(new ClearInputButton(device)); await device.inputText(newUsername, new UsernameInput(device)); diff --git a/run/test/specs/user_actions_create_contact.spec.ts b/run/test/specs/user_actions_create_contact.spec.ts index 3dd56e1d10..cbca337c47 100644 --- a/run/test/specs/user_actions_create_contact.spec.ts +++ b/run/test/specs/user_actions_create_contact.spec.ts @@ -2,13 +2,13 @@ import type { TestInfo } from '@playwright/test'; import { bothPlatformsIt } from '../../types/sessionIt'; import { USERNAME } from '../../types/testing'; -import { ConversationItem, MessageRequestsBanner } from './locators/home'; -import { newUser } from './utils/create_account'; -import { retryMsgSentForBanner } from './utils/create_contact'; -import { linkedDevice } from './utils/link_device'; -import { closeApp, openAppThreeDevices, SupportedPlatformsType } from './utils/open_app'; -import { runOnlyOnIOS } from './utils/run_on'; -import { sleepFor } from './utils/sleep_for'; +import { ConversationItem, MessageRequestsBanner } from '../locators/home'; +import { newUser } from '../utils/create_account'; +import { retryMsgSentForBanner } from '../utils/create_contact'; +import { linkedDevice } from '../utils/link_device'; +import { closeApp, openAppThreeDevices, SupportedPlatformsType } from '../utils/open_app'; +import { runOnlyOnIOS } from '../utils/run_on'; +import { sleepFor } from '../utils/sleep_for'; bothPlatformsIt({ title: 'Create contact', @@ -37,7 +37,7 @@ async function createContact(platform: SupportedPlatformsType, testInfo: TestInf // NOTE: This appears to be broken on both platforms: // Verify config message states message request was accepted // "messageRequestsAccepted": "Your message request has been accepted.", - // const messageRequestsAccepted = englishStrippedStr('messageRequestsAccepted').toString(); + // const messageRequestsAccepted = tStripped('messageRequestsAccepted'); // await device1.waitForTextElementToBePresent({ // strategy: 'accessibility id', // selector: 'Control message', diff --git a/run/test/specs/user_actions_create_user.spec.ts b/run/test/specs/user_actions_create_user.spec.ts index 24e119dd1c..a12ac645b8 100644 --- a/run/test/specs/user_actions_create_user.spec.ts +++ b/run/test/specs/user_actions_create_user.spec.ts @@ -2,8 +2,8 @@ import type { TestInfo } from '@playwright/test'; import { bothPlatformsIt } from '../../types/sessionIt'; import { USERNAME } from '../../types/testing'; -import { newUser } from './utils/create_account'; -import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from './utils/open_app'; +import { newUser } from '../utils/create_account'; +import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Create user', diff --git a/run/test/specs/user_actions_delete_contact_ucs.spec.ts b/run/test/specs/user_actions_delete_contact_ucs.spec.ts index b6e34e5065..0cbeecfc95 100644 --- a/run/test/specs/user_actions_delete_contact_ucs.spec.ts +++ b/run/test/specs/user_actions_delete_contact_ucs.spec.ts @@ -1,6 +1,6 @@ import { test, type TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { TestSteps } from '../../types/allure'; import { bothPlatformsIt } from '../../types/sessionIt'; import { USERNAME } from '../../types/testing'; @@ -9,10 +9,10 @@ import { DeleteContactConfirmButton, DeleteContactMenuItem, MessageBody, -} from './locators/conversation'; -import { ConversationItem, MessageRequestsBanner } from './locators/home'; -import { open_Alice2_Bob1_friends } from './state_builder'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +} from '../locators/conversation'; +import { ConversationItem, MessageRequestsBanner } from '../locators/home'; +import { open_Alice2_Bob1_friends } from '../state_builder'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Delete contact from conversation settings', @@ -49,8 +49,8 @@ async function deleteContactCS(platform: SupportedPlatformsType, testInfo: TestI await alice1.clickOnElementAll(new DeleteContactMenuItem(alice1)); await test.step(TestSteps.VERIFY.GENERIC_MODAL, async () => { await alice1.checkModalStrings( - englishStrippedStr('contactDelete').toString(), - englishStrippedStr('deleteContactDescription').withArgs({ name: USERNAME.BOB }).toString() + tStripped('contactDelete'), + tStripped('deleteContactDescription', { name: USERNAME.BOB }) ); }); await alice1.clickOnElementAll(new DeleteContactConfirmButton(alice1)); diff --git a/run/test/specs/user_actions_delete_conversation.spec.ts b/run/test/specs/user_actions_delete_conversation.spec.ts index 0be2e554f7..85ee6878d1 100644 --- a/run/test/specs/user_actions_delete_conversation.spec.ts +++ b/run/test/specs/user_actions_delete_conversation.spec.ts @@ -1,12 +1,12 @@ import { test, type TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { TestSteps } from '../../types/allure'; import { bothPlatformsIt } from '../../types/sessionIt'; import { USERNAME } from '../../types/testing'; -import { ConversationItem } from './locators/home'; -import { open_Alice2_Bob1_friends } from './state_builder'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +import { ConversationItem } from '../locators/home'; +import { open_Alice2_Bob1_friends } from '../state_builder'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Delete conversation from conversation list', @@ -44,10 +44,8 @@ async function deleteConversation(platform: SupportedPlatformsType, testInfo: Te }); await test.step(TestSteps.VERIFY.GENERIC_MODAL, async () => { await alice1.checkModalStrings( - englishStrippedStr('conversationsDelete').toString(), - englishStrippedStr('deleteConversationDescription') - .withArgs({ name: USERNAME.BOB }) - .toString() + tStripped('conversationsDelete'), + tStripped('deleteConversationDescription', { name: USERNAME.BOB }) ); }); await alice1.clickOnByAccessibilityID('Delete'); diff --git a/run/test/specs/user_actions_delete_conversation_ucs.spec.ts b/run/test/specs/user_actions_delete_conversation_ucs.spec.ts index 78aab68727..a9bec851f0 100644 --- a/run/test/specs/user_actions_delete_conversation_ucs.spec.ts +++ b/run/test/specs/user_actions_delete_conversation_ucs.spec.ts @@ -1,6 +1,6 @@ import { test, type TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { TestSteps } from '../../types/allure'; import { bothPlatformsIt } from '../../types/sessionIt'; import { USERNAME } from '../../types/testing'; @@ -8,10 +8,10 @@ import { ConversationSettings, DeleteConversationMenuItem, DeleteConversationModalConfirm, -} from './locators/conversation'; -import { ConversationItem } from './locators/home'; -import { open_Alice2_Bob1_friends } from './state_builder'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +} from '../locators/conversation'; +import { ConversationItem } from '../locators/home'; +import { open_Alice2_Bob1_friends } from '../state_builder'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Delete conversation from conversation settings', @@ -46,10 +46,8 @@ async function deleteConversationCS(platform: SupportedPlatformsType, testInfo: await alice1.clickOnElementAll(new DeleteConversationMenuItem(alice1)); await test.step(TestSteps.VERIFY.GENERIC_MODAL, async () => { await alice1.checkModalStrings( - englishStrippedStr('conversationsDelete').toString(), - englishStrippedStr('deleteConversationDescription') - .withArgs({ name: USERNAME.BOB }) - .toString() + tStripped('conversationsDelete'), + tStripped('deleteConversationDescription', { name: USERNAME.BOB }) ); }); await alice1.clickOnElementAll(new DeleteConversationModalConfirm(alice1)); diff --git a/run/test/specs/user_actions_hide_note_to_self.spec.ts b/run/test/specs/user_actions_hide_note_to_self.spec.ts index ce2e222c2e..bfead470c4 100644 --- a/run/test/specs/user_actions_hide_note_to_self.spec.ts +++ b/run/test/specs/user_actions_hide_note_to_self.spec.ts @@ -1,6 +1,6 @@ import { test, type TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { TestSteps } from '../../types/allure'; import { bothPlatformsIt } from '../../types/sessionIt'; import { USERNAME } from '../../types/testing'; @@ -11,12 +11,12 @@ import { HideNoteToSelfMenuOption, ShowNoteToSelfConfirmButton, ShowNoteToSelfMenuOption, -} from './locators/conversation'; -import { NoteToSelfOption } from './locators/global_search'; -import { CancelSearchButton } from './locators/global_search'; -import { ConversationItem, SearchButton } from './locators/home'; -import { newUser } from './utils/create_account'; -import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from './utils/open_app'; +} from '../locators/conversation'; +import { NoteToSelfOption } from '../locators/global_search'; +import { CancelSearchButton } from '../locators/global_search'; +import { ConversationItem, SearchButton } from '../locators/home'; +import { newUser } from '../utils/create_account'; +import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Hide note to self', @@ -32,7 +32,7 @@ bothPlatformsIt({ }); async function hideNoteToSelf(platform: SupportedPlatformsType, testInfo: TestInfo) { - const noteToSelf = englishStrippedStr('noteToSelf').toString(); + const noteToSelf = tStripped('noteToSelf'); const { device } = await test.step(TestSteps.SETUP.NEW_USER, async () => { const { device } = await openAppOnPlatformSingleDevice(platform, testInfo); @@ -53,8 +53,8 @@ async function hideNoteToSelf(platform: SupportedPlatformsType, testInfo: TestIn await test.step(TestSteps.VERIFY.GENERIC_MODAL, async () => { await device.checkModalStrings( - englishStrippedStr('noteToSelfHide').toString(), - englishStrippedStr('hideNoteToSelfDescription').toString() + tStripped('noteToSelfHide'), + tStripped('hideNoteToSelfDescription') ); }); await device.clickOnElementAll(new HideNoteToSelfConfirmButton(device)); @@ -79,8 +79,8 @@ async function hideNoteToSelf(platform: SupportedPlatformsType, testInfo: TestIn await test.step(TestSteps.VERIFY.GENERIC_MODAL, async () => { await device.checkModalStrings( - englishStrippedStr('showNoteToSelf').toString(), - englishStrippedStr('showNoteToSelfDescription').toString() + tStripped('showNoteToSelf'), + tStripped('showNoteToSelfDescription') ); }); await device.clickOnElementAll(new ShowNoteToSelfConfirmButton(device)); diff --git a/run/test/specs/user_actions_hide_recovery_password.spec.ts b/run/test/specs/user_actions_hide_recovery_password.spec.ts index cd6e1fd3c9..5e04c5a897 100644 --- a/run/test/specs/user_actions_hide_recovery_password.spec.ts +++ b/run/test/specs/user_actions_hide_recovery_password.spec.ts @@ -1,17 +1,17 @@ import type { TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { bothPlatformsIt } from '../../types/sessionIt'; import { USERNAME } from '../../types/testing'; -import { AccountIDDisplay, ContinueButton } from './locators/global'; +import { AccountIDDisplay, ContinueButton } from '../locators/global'; import { HideRecoveryPasswordButton, RecoveryPasswordMenuItem, UserSettings, YesButton, -} from './locators/settings'; -import { linkedDevice } from './utils/link_device'; -import { closeApp, openAppTwoDevices, SupportedPlatformsType } from './utils/open_app'; +} from '../locators/settings'; +import { linkedDevice } from '../utils/link_device'; +import { closeApp, openAppTwoDevices, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Hide recovery password', @@ -30,15 +30,15 @@ async function hideRecoveryPassword(platform: SupportedPlatformsType, testInfo: // Wait for modal to appear // Check modal is correct await device1.checkModalStrings( - englishStrippedStr('recoveryPasswordHidePermanently').toString(), - englishStrippedStr('recoveryPasswordHidePermanentlyDescription1').toString() + tStripped('recoveryPasswordHidePermanently'), + tStripped('recoveryPasswordHidePermanentlyDescription1') ); // Click on continue await device1.clickOnElementAll(new ContinueButton(device1)); // Check confirmation modal await device1.checkModalStrings( - englishStrippedStr('recoveryPasswordHidePermanently').toString(), - englishStrippedStr('recoveryPasswordHidePermanentlyDescription2').toString() + tStripped('recoveryPasswordHidePermanently'), + tStripped('recoveryPasswordHidePermanentlyDescription2') ); // Click on Yes await device1.clickOnElementAll(new YesButton(device1)); diff --git a/run/test/specs/user_actions_read_status.spec.ts b/run/test/specs/user_actions_read_status.spec.ts index bac9194e36..19af73596a 100644 --- a/run/test/specs/user_actions_read_status.spec.ts +++ b/run/test/specs/user_actions_read_status.spec.ts @@ -1,11 +1,11 @@ import type { TestInfo } from '@playwright/test'; import { bothPlatformsIt } from '../../types/sessionIt'; -import { MessageBody } from './locators/conversation'; -import { ConversationItem } from './locators/home'; -import { open_Alice1_Bob1_friends } from './state_builder'; -import { sleepFor } from './utils/index'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +import { MessageBody } from '../locators/conversation'; +import { ConversationItem } from '../locators/home'; +import { open_Alice1_Bob1_friends } from '../state_builder'; +import { sleepFor } from '../utils/index'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Read status', diff --git a/run/test/specs/user_actions_set_nickname.spec.ts b/run/test/specs/user_actions_set_nickname.spec.ts index 253ee7a4c3..4c84d5e0fd 100644 --- a/run/test/specs/user_actions_set_nickname.spec.ts +++ b/run/test/specs/user_actions_set_nickname.spec.ts @@ -1,6 +1,6 @@ import { test, type TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { TestSteps } from '../../types/allure'; import { bothPlatformsIt } from '../../types/sessionIt'; import { USERNAME } from '../../types/testing'; @@ -11,10 +11,10 @@ import { NicknameInput, PreferredDisplayName, SaveNicknameButton, -} from './locators/conversation'; -import { ConversationItem } from './locators/home'; -import { open_Alice1_Bob1_friends } from './state_builder'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +} from '../locators/conversation'; +import { ConversationItem } from '../locators/home'; +import { open_Alice1_Bob1_friends } from '../state_builder'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Set nickname', @@ -44,8 +44,8 @@ async function setNickname(platform: SupportedPlatformsType, testInfo: TestInfo) await alice1.clickOnElementAll(new EditNicknameButton(alice1)); await test.step(TestSteps.VERIFY.SPECIFIC_MODAL('Set Nickname'), async () => { await alice1.checkModalStrings( - englishStrippedStr('nicknameSet').toString(), - englishStrippedStr('nicknameDescription').withArgs({ name: USERNAME.BOB }).toString() + tStripped('nicknameSet'), + tStripped('nicknameDescription', { name: USERNAME.BOB }) ); }); await alice1.clickOnElementAll(new NicknameInput(alice1)); diff --git a/run/test/specs/user_actions_share_to_session.spec.ts b/run/test/specs/user_actions_share_to_session.spec.ts index f2728ff908..952c18384e 100644 --- a/run/test/specs/user_actions_share_to_session.spec.ts +++ b/run/test/specs/user_actions_share_to_session.spec.ts @@ -4,14 +4,14 @@ import { testImage } from '../../constants/testfiles'; import { TestSteps } from '../../types/allure'; import { bothPlatformsIt } from '../../types/sessionIt'; import { USERNAME } from '../../types/testing'; -import { ImageName, ShareExtensionIcon } from './locators'; -import { MessageBody, MessageInput, SendButton } from './locators/conversation'; -import { PhotoLibrary } from './locators/external'; -import { Contact } from './locators/global'; -import { open_Alice1_Bob1_friends } from './state_builder'; -import { sleepFor } from './utils'; -import { handlePhotosFirstTimeOpen } from './utils/handle_first_open'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +import { ImageName, ShareExtensionIcon } from '../locators'; +import { MessageBody, MessageInput, SendButton } from '../locators/conversation'; +import { PhotoLibrary } from '../locators/external'; +import { Contact } from '../locators/global'; +import { open_Alice1_Bob1_friends } from '../state_builder'; +import { sleepFor } from '../utils'; +import { handlePhotosFirstTimeOpen } from '../utils/handle_first_open'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Share to session', diff --git a/run/test/specs/user_actions_unblock_user.spec.ts b/run/test/specs/user_actions_unblock_user.spec.ts index 3964203321..f5f14aef8a 100644 --- a/run/test/specs/user_actions_unblock_user.spec.ts +++ b/run/test/specs/user_actions_unblock_user.spec.ts @@ -1,11 +1,11 @@ import type { TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { bothPlatformsIt } from '../../types/sessionIt'; -import { BlockUser, BlockUserConfirmationModal } from './locators'; -import { BlockedBanner, ConversationSettings, MessageBody } from './locators/conversation'; -import { open_Alice1_Bob1_friends } from './state_builder'; -import { SupportedPlatformsType } from './utils/open_app'; +import { BlockUser, BlockUserConfirmationModal } from '../locators'; +import { BlockedBanner, ConversationSettings, MessageBody } from '../locators/conversation'; +import { open_Alice1_Bob1_friends } from '../state_builder'; +import { SupportedPlatformsType } from '../utils/open_app'; bothPlatformsIt({ title: 'Unblock user', @@ -32,8 +32,8 @@ async function unblockUser(platform: SupportedPlatformsType, testInfo: TestInfo) await alice1.clickOnElementAll(new ConversationSettings(alice1)); await alice1.clickOnElementAll(new BlockUser(alice1)); await alice1.checkModalStrings( - englishStrippedStr('block').toString(), - englishStrippedStr('blockDescription').withArgs({ name: bob.userName }).toString() + tStripped('block'), + tStripped('blockDescription', { name: bob.userName }) ); await alice1.clickOnElementAll(new BlockUserConfirmationModal(alice1)); await alice1.navigateBack(); @@ -55,8 +55,8 @@ async function unblockUser(platform: SupportedPlatformsType, testInfo: TestInfo) // Now that user is blocked, unblock them await alice1.clickOnElementAll(new BlockedBanner(alice1)); await alice1.checkModalStrings( - englishStrippedStr('blockUnblock').toString(), - englishStrippedStr('blockUnblockName').withArgs({ name: bob.userName }).toString() + tStripped('blockUnblock'), + tStripped('blockUnblockName', { name: bob.userName }) ); await alice1.clickOnElementAll({ strategy: 'accessibility id', selector: 'Unblock' }); await alice1.verifyElementNotPresent({ ...new BlockedBanner(alice1).build(), maxWait: 2000 }); diff --git a/run/test/specs/visual_message_bubbles.spec.ts b/run/test/specs/visual_message_bubbles.spec.ts index 0a732d9b8a..9348fa9f87 100644 --- a/run/test/specs/visual_message_bubbles.spec.ts +++ b/run/test/specs/visual_message_bubbles.spec.ts @@ -7,11 +7,11 @@ import { MessageInput, OutgoingMessageStatusSent, SendButton, -} from './locators/conversation'; -import { open_Alice1_Bob1_friends } from './state_builder'; -import { sleepFor } from './utils'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; -import { verifyPageScreenshot } from './utils/verify_screenshots'; +} from '../locators/conversation'; +import { open_Alice1_Bob1_friends } from '../state_builder'; +import { sleepFor } from '../utils'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; +import { verifyPageScreenshot } from '../utils/verify_screenshots'; bothPlatformsIt({ title: 'Check message bubble layout', diff --git a/run/test/specs/visual_settings.spec.ts b/run/test/specs/visual_settings.spec.ts index 7405071034..9050a88f90 100644 --- a/run/test/specs/visual_settings.spec.ts +++ b/run/test/specs/visual_settings.spec.ts @@ -4,17 +4,17 @@ import { TestSteps } from '../../types/allure'; import { DeviceWrapper } from '../../types/DeviceWrapper'; import { bothPlatformsIt } from '../../types/sessionIt'; import { USERNAME } from '../../types/testing'; -import { NotificationsMenuItem } from './locators/settings'; +import { NotificationsMenuItem } from '../locators/settings'; import { AppearanceMenuItem, ConversationsMenuItem, PrivacyMenuItem, UserSettings, -} from './locators/settings'; -import { sleepFor } from './utils'; -import { newUser } from './utils/create_account'; -import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from './utils/open_app'; -import { verifyPageScreenshot } from './utils/verify_screenshots'; +} from '../locators/settings'; +import { sleepFor } from '../utils'; +import { newUser } from '../utils/create_account'; +import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from '../utils/open_app'; +import { verifyPageScreenshot } from '../utils/verify_screenshots'; const testCases = [ { diff --git a/run/test/specs/voice_calls.spec.ts b/run/test/specs/voice_calls.spec.ts index ba2a48064a..49925f26a5 100644 --- a/run/test/specs/voice_calls.spec.ts +++ b/run/test/specs/voice_calls.spec.ts @@ -1,13 +1,13 @@ import { test, type TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { TestSteps } from '../../types/allure'; import { bothPlatformsItSeparate } from '../../types/sessionIt'; -import { CloseSettings } from './locators'; -import { CallButton, NotificationsModalButton, NotificationSwitch } from './locators/conversation'; -import { open_Alice1_Bob1_friends } from './state_builder'; -import { sleepFor } from './utils/index'; -import { closeApp, SupportedPlatformsType } from './utils/open_app'; +import { CloseSettings } from '../locators'; +import { CallButton, NotificationsModalButton, NotificationSwitch } from '../locators/conversation'; +import { open_Alice1_Bob1_friends } from '../state_builder'; +import { sleepFor } from '../utils/index'; +import { closeApp, SupportedPlatformsType } from '../utils/open_app'; bothPlatformsItSeparate({ title: 'Voice calls', @@ -47,15 +47,15 @@ async function voiceCallIos(platform: SupportedPlatformsType, testInfo: TestInfo await test.step(TestSteps.CALLS.ACCEPT_PERMS(alice.userName), async () => { await test.step(TestSteps.VERIFY.SPECIFIC_MODAL('enable calls permission'), async () => { await alice1.checkModalStrings( - englishStrippedStr('callsPermissionsRequired').toString(), - englishStrippedStr('callsPermissionsRequiredDescription').toString() + tStripped('callsPermissionsRequired'), + tStripped('callsPermissionsRequiredDescription') ); }); await alice1.clickOnByAccessibilityID('Settings'); await test.step(TestSteps.VERIFY.SPECIFIC_MODAL('beta calls'), async () => { await alice1.checkModalStrings( - englishStrippedStr('callsVoiceAndVideoBeta').toString(), - englishStrippedStr('callsVoiceAndVideoModalDescription').toString() + tStripped('callsVoiceAndVideoBeta'), + tStripped('callsVoiceAndVideoModalDescription') ); }); await alice1.clickOnByAccessibilityID('Continue'); @@ -83,10 +83,8 @@ async function voiceCallIos(platform: SupportedPlatformsType, testInfo: TestInfo await test.step(TestSteps.CALLS.INITIATE_CALL(alice.userName), async () => { await alice1.clickOnElementAll(new CallButton(alice1)); await bob1.checkModalStrings( - englishStrippedStr('callsMissedCallFrom').withArgs({ name: alice.userName }).toString(), - englishStrippedStr('callsYouMissedCallPermissions') - .withArgs({ name: alice.userName }) - .toString() + tStripped('callsMissedCallFrom', { name: alice.userName }), + tStripped('callsYouMissedCallPermissions', { name: alice.userName }) ); await bob1.clickOnByAccessibilityID('Settings'); await alice1.waitForTextElementToBePresent({ @@ -102,8 +100,8 @@ async function voiceCallIos(platform: SupportedPlatformsType, testInfo: TestInfo await alice1.clickOnByAccessibilityID('End call button'); }); await bob1.checkModalStrings( - englishStrippedStr('callsVoiceAndVideoBeta').toString(), - englishStrippedStr('callsVoiceAndVideoModalDescription').toString() + tStripped('callsVoiceAndVideoBeta'), + tStripped('callsVoiceAndVideoModalDescription') ); await bob1.clickOnByAccessibilityID('Continue'); // Need to allow microphone access @@ -140,13 +138,9 @@ async function voiceCallIos(platform: SupportedPlatformsType, testInfo: TestInfo ); await alice1.clickOnByAccessibilityID('End call button'); // Check for control messages on both devices - const callsYouCalled = englishStrippedStr('callsYouCalled') - .withArgs({ name: bob.userName }) - .toString(); + const callsYouCalled = tStripped('callsYouCalled', { name: bob.userName }); await alice1.waitForControlMessageToBePresent(callsYouCalled); - const callsCalledYou = englishStrippedStr('callsCalledYou') - .withArgs({ name: alice.userName }) - .toString(); + const callsCalledYou = tStripped('callsCalledYou', { name: alice.userName }); await bob1.waitForControlMessageToBePresent(callsCalledYou); await test.step(TestSteps.SETUP.CLOSE_APP, async () => { await closeApp(alice1, bob1); @@ -171,8 +165,8 @@ async function voiceCallAndroid(platform: SupportedPlatformsType, testInfo: Test // Alice turns on all calls perms necessary await test.step(TestSteps.VERIFY.SPECIFIC_MODAL('enable calls permission'), async () => { await alice1.checkModalStrings( - englishStrippedStr('callsPermissionsRequired').toString(), - englishStrippedStr('callsPermissionsRequiredDescription').toString() + tStripped('callsPermissionsRequired'), + tStripped('callsPermissionsRequiredDescription') ); await alice1.clickOnElementAll({ strategy: 'accessibility id', @@ -181,8 +175,8 @@ async function voiceCallAndroid(platform: SupportedPlatformsType, testInfo: Test }); await test.step(TestSteps.VERIFY.SPECIFIC_MODAL('beta calls'), async () => { await alice1.checkModalStrings( - englishStrippedStr('callsVoiceAndVideoBeta').toString(), - englishStrippedStr('callsVoiceAndVideoModalDescription').toString() + tStripped('callsVoiceAndVideoBeta'), + tStripped('callsVoiceAndVideoModalDescription') ); await alice1.clickOnByAccessibilityID('Enable'); }); @@ -191,8 +185,8 @@ async function voiceCallAndroid(platform: SupportedPlatformsType, testInfo: Test ); await test.step(TestSteps.VERIFY.SPECIFIC_MODAL('notifications permission'), async () => { await alice1.checkModalStrings( - englishStrippedStr('sessionNotifications').toString(), - englishStrippedStr('callsNotificationsRequired').toString() + tStripped('sessionNotifications'), + tStripped('callsNotificationsRequired') ); await alice1.clickOnElementAll(new NotificationsModalButton(alice1)); await alice1.clickOnElementAll(new NotificationSwitch(alice1)); diff --git a/run/test/specs/warning_modal_new_account.spec.ts b/run/test/specs/warning_modal_new_account.spec.ts index 90df761eec..8c6055ab0e 100644 --- a/run/test/specs/warning_modal_new_account.spec.ts +++ b/run/test/specs/warning_modal_new_account.spec.ts @@ -1,17 +1,17 @@ import type { TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { androidIt } from '../../types/sessionIt'; import { USERNAME } from '../../types/testing'; -import { ContinueButton } from '../specs/locators/global'; +import { ContinueButton } from '../locators/global'; import { BackButton, CreateAccountButton, DisplayNameInput, SlowModeRadio, WarningModalQuitButton, -} from './locators/onboarding'; -import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from './utils/open_app'; +} from '../locators/onboarding'; +import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from '../utils/open_app'; // These modals no longer exist in groups rebuild for iOS androidIt({ @@ -34,10 +34,7 @@ async function warningModalNewAccount(platform: SupportedPlatformsType, testInfo await device.waitForTextElementToBePresent(new DisplayNameInput(device)); // Pressing Back on the Display Name screen to trigger the Warning modal await device.clickOnElementAll(new BackButton(device)); - await device.checkModalStrings( - englishStrippedStr('warning').toString(), - englishStrippedStr('onboardingBackAccountCreation').toString() - ); + await device.checkModalStrings(tStripped('warning'), tStripped('onboardingBackAccountCreation')); await device.clickOnElementAll(new WarningModalQuitButton(device)); await closeApp(device); } diff --git a/run/test/specs/warning_modal_restore_account.spec.ts b/run/test/specs/warning_modal_restore_account.spec.ts index b18a02de4f..5092f402bf 100644 --- a/run/test/specs/warning_modal_restore_account.spec.ts +++ b/run/test/specs/warning_modal_restore_account.spec.ts @@ -1,16 +1,16 @@ import type { TestInfo } from '@playwright/test'; -import { englishStrippedStr } from '../../localizer/englishStrippedStr'; +import { tStripped } from '../../localizer/lib'; import { androidIt } from '../../types/sessionIt'; -import { ContinueButton } from '../specs/locators/global'; +import { ContinueButton } from '../locators/global'; import { AccountRestoreButton, BackButton, SeedPhraseInput, SlowModeRadio, WarningModalQuitButton, -} from './locators/onboarding'; -import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from './utils/open_app'; +} from '../locators/onboarding'; +import { closeApp, openAppOnPlatformSingleDevice, SupportedPlatformsType } from '../utils/open_app'; // These modals no longer exist in groups rebuild for iOS androidIt({ title: 'Warning modal on restore account', @@ -30,10 +30,7 @@ async function warningModalRestoreAccount(platform: SupportedPlatformsType, test await device.waitForTextElementToBePresent(new SlowModeRadio(device).build()); // Pressing Back on the Message Notifications screen to trigger the Warning modal await device.clickOnElementAll(new BackButton(device)); - await device.checkModalStrings( - englishStrippedStr('warning').toString(), - englishStrippedStr('onboardingBackLoadAccount').toString() - ); + await device.checkModalStrings(tStripped('warning'), tStripped('onboardingBackLoadAccount')); await device.clickOnElementAll(new WarningModalQuitButton(device)); await closeApp(device); } diff --git a/run/test/specs/state_builder/index.ts b/run/test/state_builder/index.ts similarity index 99% rename from run/test/specs/state_builder/index.ts rename to run/test/state_builder/index.ts index 9944a20b5a..e448a90121 100644 --- a/run/test/specs/state_builder/index.ts +++ b/run/test/state_builder/index.ts @@ -13,7 +13,7 @@ import { type WithGroupStateKey, } from '@session-foundation/qa-seeder'; -import type { DeviceWrapper } from '../../../types/DeviceWrapper'; +import type { DeviceWrapper } from '../../types/DeviceWrapper'; import { ConversationItem } from '../locators/home'; import { getNetworkTarget } from '../utils/devnet'; diff --git a/run/test/specs/utils/allure/allureHelpers.ts b/run/test/utils/allure/allureHelpers.ts similarity index 98% rename from run/test/specs/utils/allure/allureHelpers.ts rename to run/test/utils/allure/allureHelpers.ts index eeabca5ad6..2cb1c4e5e7 100644 --- a/run/test/specs/utils/allure/allureHelpers.ts +++ b/run/test/utils/allure/allureHelpers.ts @@ -8,8 +8,8 @@ import { allureCurrentReportDir, allureResultsDir, GH_PAGES_BASE_URL, -} from '../../../../constants/allure'; -import { AllureSuiteConfig } from '../../../../types/allure'; +} from '../../../constants/allure'; +import { AllureSuiteConfig } from '../../../types/allure'; import { SupportedPlatformsType } from '../open_app'; export interface ReportContext { diff --git a/run/test/specs/utils/allure/closeRun.ts b/run/test/utils/allure/closeRun.ts similarity index 98% rename from run/test/specs/utils/allure/closeRun.ts rename to run/test/utils/allure/closeRun.ts index 8052c0cfcf..78907f915c 100644 --- a/run/test/specs/utils/allure/closeRun.ts +++ b/run/test/utils/allure/closeRun.ts @@ -1,7 +1,7 @@ import { exec } from 'child_process'; import fs from 'fs-extra'; -import { allureCurrentReportDir, allureResultsDir } from '../../../../constants/allure'; +import { allureCurrentReportDir, allureResultsDir } from '../../../constants/allure'; import { getReportContextFromEnv, writeEnvironmentProperties, diff --git a/run/test/specs/utils/allure/publishReport.ts b/run/test/utils/allure/publishReport.ts similarity index 98% rename from run/test/specs/utils/allure/publishReport.ts rename to run/test/utils/allure/publishReport.ts index 747ccb4d91..db6e941823 100644 --- a/run/test/specs/utils/allure/publishReport.ts +++ b/run/test/utils/allure/publishReport.ts @@ -2,7 +2,7 @@ import fs from 'fs-extra'; import ghpages from 'gh-pages'; import path from 'path'; -import { allureCurrentReportDir } from '../../../../constants/allure'; +import { allureCurrentReportDir } from '../../../constants/allure'; import { getReportContextFromEnv, patchFilesForLFSCDN, diff --git a/run/test/specs/utils/binaries.ts b/run/test/utils/binaries.ts similarity index 100% rename from run/test/specs/utils/binaries.ts rename to run/test/utils/binaries.ts diff --git a/run/test/specs/utils/capabilities_android.ts b/run/test/utils/capabilities_android.ts similarity index 100% rename from run/test/specs/utils/capabilities_android.ts rename to run/test/utils/capabilities_android.ts diff --git a/run/test/specs/utils/capabilities_ios.ts b/run/test/utils/capabilities_ios.ts similarity index 98% rename from run/test/specs/utils/capabilities_ios.ts rename to run/test/utils/capabilities_ios.ts index 4bc8379eef..27327478f3 100644 --- a/run/test/specs/utils/capabilities_ios.ts +++ b/run/test/utils/capabilities_ios.ts @@ -3,7 +3,7 @@ import { W3CXCUITestDriverCaps } from 'appium-xcuitest-driver/build/lib/driver'; import dotenv from 'dotenv'; import { existsSync, readFileSync } from 'fs'; -import { IntRange } from '../../../types/RangeType'; +import { IntRange } from '../../types/RangeType'; dotenv.config({ quiet: true }); diff --git a/run/test/specs/utils/check_colour.ts b/run/test/utils/check_colour.ts similarity index 100% rename from run/test/specs/utils/check_colour.ts rename to run/test/utils/check_colour.ts diff --git a/run/test/specs/utils/click_by_coordinates.ts b/run/test/utils/click_by_coordinates.ts similarity index 70% rename from run/test/specs/utils/click_by_coordinates.ts rename to run/test/utils/click_by_coordinates.ts index bbe2b94af2..707649b88d 100644 --- a/run/test/specs/utils/click_by_coordinates.ts +++ b/run/test/utils/click_by_coordinates.ts @@ -1,5 +1,5 @@ -import { DeviceWrapper } from '../../../types/DeviceWrapper'; -import { Coordinates } from '../../../types/testing'; +import { DeviceWrapper } from '../../types/DeviceWrapper'; +import { Coordinates } from '../../types/testing'; import { sleepFor } from './sleep_for'; export const clickOnCoordinates = async (device: DeviceWrapper, coordinates: Coordinates) => { diff --git a/run/test/specs/utils/copy_file_to_simulator.ts b/run/test/utils/copy_file_to_simulator.ts similarity index 95% rename from run/test/specs/utils/copy_file_to_simulator.ts rename to run/test/utils/copy_file_to_simulator.ts index 8d2eb80a6a..c7618b9fec 100644 --- a/run/test/specs/utils/copy_file_to_simulator.ts +++ b/run/test/utils/copy_file_to_simulator.ts @@ -2,10 +2,10 @@ import { execSync } from 'child_process'; import * as fs from 'fs'; import * as path from 'path'; -import { DeviceWrapper } from '../../../types/DeviceWrapper'; +import { DeviceWrapper } from '../../types/DeviceWrapper'; const TARGET_GROUP_ID = 'group.com.apple.FileProvider.LocalStorage'; -const MEDIA_ROOT = path.join('run', 'test', 'specs', 'media'); +const MEDIA_ROOT = path.join('run', 'test', 'media'); /** * Utility for copying a file from the local 'media' directory to the current iOS simulator's diff --git a/run/test/specs/utils/create_account.ts b/run/test/utils/create_account.ts similarity index 96% rename from run/test/specs/utils/create_account.ts rename to run/test/utils/create_account.ts index 180acdbc16..37ffe96cab 100644 --- a/run/test/specs/utils/create_account.ts +++ b/run/test/utils/create_account.ts @@ -1,7 +1,7 @@ import type { UserNameType } from '@session-foundation/qa-seeder'; -import { DeviceWrapper } from '../../../types/DeviceWrapper'; -import { User } from '../../../types/testing'; +import { DeviceWrapper } from '../../types/DeviceWrapper'; +import { User } from '../../types/testing'; import { CloseSettings } from '../locators'; import { AccountIDDisplay, ContinueButton } from '../locators/global'; import { CreateAccountButton, DisplayNameInput, FastModeRadio } from '../locators/onboarding'; diff --git a/run/test/specs/utils/create_contact.ts b/run/test/utils/create_contact.ts similarity index 92% rename from run/test/specs/utils/create_contact.ts rename to run/test/utils/create_contact.ts index eeba536f2c..120be5392b 100644 --- a/run/test/specs/utils/create_contact.ts +++ b/run/test/utils/create_contact.ts @@ -1,6 +1,6 @@ import { runOnlyOnIOS, sleepFor } from '.'; -import { DeviceWrapper } from '../../../types/DeviceWrapper'; -import { User } from '../../../types/testing'; +import { DeviceWrapper } from '../../types/DeviceWrapper'; +import { User } from '../../types/testing'; import { MessageBody } from '../locators/conversation'; import { MessageRequestsBanner } from '../locators/home'; import { SupportedPlatformsType } from './open_app'; @@ -27,7 +27,7 @@ export const newContact = async ( // Verify config message states message request was accepted // "messageRequestsAccepted": "Your message request has been accepted.", // TO DO - ADD BACK IN ONCE IOS AND ANDROID HAS FIXED THIS ISSUE - // const messageRequestsAccepted = englishStrippedStr('messageRequestsAccepted').toString(); + // const messageRequestsAccepted = tStripped('messageRequestsAccepted'); // await device1.onAndroid().waitForControlMessageToBePresent(messageRequestsAccepted); await device1.waitForTextElementToBePresent(new MessageBody(device1, replyMessage)); console.info(`${sender.userName} and ${receiver.userName} are now contacts`); diff --git a/run/test/specs/utils/create_group.ts b/run/test/utils/create_group.ts similarity index 85% rename from run/test/specs/utils/create_group.ts rename to run/test/utils/create_group.ts index 3e0eae2f38..cbf49f2491 100644 --- a/run/test/specs/utils/create_group.ts +++ b/run/test/utils/create_group.ts @@ -1,6 +1,6 @@ -import { englishStrippedStr } from '../../../localizer/englishStrippedStr'; -import { DeviceWrapper } from '../../../types/DeviceWrapper'; -import { Group, GROUPNAME, User } from '../../../types/testing'; +import { tStripped } from '../../localizer/lib'; +import { DeviceWrapper } from '../../types/DeviceWrapper'; +import { Group, GROUPNAME, User } from '../../types/testing'; import { MessageBody } from '../locators/conversation'; import { Contact } from '../locators/global'; import { CreateGroupButton, GroupNameInput } from '../locators/groups'; @@ -66,19 +66,13 @@ export const createGroup = async ( device1 .onIOS() .waitForControlMessageToBePresent( - englishStrippedStr(`groupMemberNewTwo`) - .withArgs({ name: firstUser, other_name: secondUser }) - .toString() + tStripped(`groupMemberNewTwo`, { name: firstUser, other_name: secondUser }) ), device2.waitForControlMessageToBePresent( - englishStrippedStr('groupInviteYouAndOtherNew') - .withArgs({ other_name: userThree.userName }) - .toString() + tStripped('groupInviteYouAndOtherNew', { other_name: userThree.userName }) ), device3.waitForControlMessageToBePresent( - englishStrippedStr('groupInviteYouAndOtherNew') - .withArgs({ other_name: userTwo.userName }) - .toString() + tStripped('groupInviteYouAndOtherNew', { other_name: userTwo.userName }) ), ]); } diff --git a/run/test/specs/utils/devnet.ts b/run/test/utils/devnet.ts similarity index 97% rename from run/test/specs/utils/devnet.ts rename to run/test/utils/devnet.ts index 091023d105..d6fecd7ad3 100644 --- a/run/test/specs/utils/devnet.ts +++ b/run/test/utils/devnet.ts @@ -2,8 +2,8 @@ import { buildStateForTest } from '@session-foundation/qa-seeder'; import type { SupportedPlatformsType } from './open_app'; -import { DEVNET_URL } from '../../../constants'; -import { AppName } from '../../../types/testing'; +import { DEVNET_URL } from '../../constants'; +import { AppName } from '../../types/testing'; import { getAndroidApk } from './binaries'; import { sleepFor } from './sleep_for'; diff --git a/run/test/specs/utils/disappearing_control_messages.ts b/run/test/utils/disappearing_control_messages.ts similarity index 71% rename from run/test/specs/utils/disappearing_control_messages.ts rename to run/test/utils/disappearing_control_messages.ts index ea2b22a4ba..db29c27023 100644 --- a/run/test/specs/utils/disappearing_control_messages.ts +++ b/run/test/utils/disappearing_control_messages.ts @@ -1,8 +1,8 @@ import type { UserNameType } from '@session-foundation/qa-seeder'; -import { englishStrippedStr } from '../../../localizer/englishStrippedStr'; -import { DeviceWrapper } from '../../../types/DeviceWrapper'; -import { DisappearActions, DISAPPEARING_TIMES } from '../../../types/testing'; +import { tStripped } from '../../localizer/lib'; +import { DeviceWrapper } from '../../types/DeviceWrapper'; +import { DisappearActions, DISAPPEARING_TIMES } from '../../types/testing'; import { ConversationItem } from '../locators/home'; import { SupportedPlatformsType } from './open_app'; @@ -18,16 +18,21 @@ export const checkDisappearingControlMessage = async ( ) => { // Two control messages to check - You have set and other user has set // "disappearingMessagesSet": "{name} has set messages to disappear {time} after they have been {disappearing_messages_type}.", - const disappearingMessagesSetAlice = englishStrippedStr('disappearingMessagesSet') - .withArgs({ name: userNameA, time, disappearing_messages_type: mode }) - .toString(); - const disappearingMessagesSetBob = englishStrippedStr('disappearingMessagesSet') - .withArgs({ name: userNameB, time, disappearing_messages_type: mode }) - .toString(); + const disappearingMessagesSetAlice = tStripped('disappearingMessagesSet', { + name: userNameA, + time, + disappearing_messages_type: mode, + }); + const disappearingMessagesSetBob = tStripped('disappearingMessagesSet', { + name: userNameB, + time, + disappearing_messages_type: mode, + }); // "disappearingMessagesSetYou": "You set messages to disappear {time} after they have been {disappearing_messages_type}.", - const disappearingMessagesSetYou = englishStrippedStr('disappearingMessagesSetYou') - .withArgs({ time, disappearing_messages_type: mode }) - .toString(); + const disappearingMessagesSetYou = tStripped('disappearingMessagesSetYou', { + time, + disappearing_messages_type: mode, + }); // Check device 1 if (platform === 'android') { await Promise.all([ diff --git a/run/test/specs/utils/get_account_id.ts b/run/test/utils/get_account_id.ts similarity index 92% rename from run/test/specs/utils/get_account_id.ts rename to run/test/utils/get_account_id.ts index 4820217e21..64f104c8d6 100644 --- a/run/test/specs/utils/get_account_id.ts +++ b/run/test/utils/get_account_id.ts @@ -1,4 +1,4 @@ -import { User } from '../../../types/testing'; +import { User } from '../../types/testing'; import { SupportedPlatformsType } from './open_app'; export function sortByPubkey(...users: Array) { diff --git a/run/test/specs/utils/handle_first_open.ts b/run/test/utils/handle_first_open.ts similarity index 97% rename from run/test/specs/utils/handle_first_open.ts rename to run/test/utils/handle_first_open.ts index 5c6a79fbbb..59c1497db4 100644 --- a/run/test/specs/utils/handle_first_open.ts +++ b/run/test/utils/handle_first_open.ts @@ -1,4 +1,4 @@ -import { DeviceWrapper } from '../../../types/DeviceWrapper'; +import { DeviceWrapper } from '../../types/DeviceWrapper'; import { ChromeNotificationsNegativeButton, ChromeUseWithoutAnAccount } from '../locators/browsers'; import { iOSPhotosContinuebutton } from '../locators/external'; diff --git a/run/test/specs/utils/index.ts b/run/test/utils/index.ts similarity index 100% rename from run/test/specs/utils/index.ts rename to run/test/utils/index.ts diff --git a/run/test/specs/utils/join_community.ts b/run/test/utils/join_community.ts similarity index 93% rename from run/test/specs/utils/join_community.ts rename to run/test/utils/join_community.ts index 342d1d4a39..5a9faea85e 100644 --- a/run/test/specs/utils/join_community.ts +++ b/run/test/utils/join_community.ts @@ -1,4 +1,4 @@ -import { DeviceWrapper } from '../../../types/DeviceWrapper'; +import { DeviceWrapper } from '../../types/DeviceWrapper'; import { CommunityInput, JoinCommunityButton } from '../locators'; import { ConversationHeaderName, EmptyConversation } from '../locators/conversation'; import { PlusButton } from '../locators/home'; diff --git a/run/test/specs/utils/link_device.ts b/run/test/utils/link_device.ts similarity index 97% rename from run/test/specs/utils/link_device.ts rename to run/test/utils/link_device.ts index d9f755a748..3c94d7cd81 100644 --- a/run/test/specs/utils/link_device.ts +++ b/run/test/utils/link_device.ts @@ -1,7 +1,7 @@ import type { UserNameType } from '@session-foundation/qa-seeder'; import { sleepFor } from '.'; -import { DeviceWrapper } from '../../../types/DeviceWrapper'; +import { DeviceWrapper } from '../../types/DeviceWrapper'; import { ContinueButton } from '../locators/global'; import { PlusButton } from '../locators/home'; import { diff --git a/run/test/specs/utils/network_api.ts b/run/test/utils/network_api.ts similarity index 100% rename from run/test/specs/utils/network_api.ts rename to run/test/utils/network_api.ts diff --git a/run/test/specs/utils/open_app.ts b/run/test/utils/open_app.ts similarity index 99% rename from run/test/specs/utils/open_app.ts rename to run/test/utils/open_app.ts index 5099c18c37..f9f1d9b31a 100644 --- a/run/test/specs/utils/open_app.ts +++ b/run/test/utils/open_app.ts @@ -5,7 +5,7 @@ import { XCUITestDriverOpts } from 'appium-xcuitest-driver/build/lib/driver'; import { DriverOpts } from 'appium/build/lib/appium'; import { compact } from 'lodash'; -import { DeviceWrapper } from '../../../types/DeviceWrapper'; +import { DeviceWrapper } from '../../types/DeviceWrapper'; import { getAdbFullPath, getAndroidSystemImageToUse, diff --git a/run/test/specs/utils/permissions.ts b/run/test/utils/permissions.ts similarity index 97% rename from run/test/specs/utils/permissions.ts rename to run/test/utils/permissions.ts index a9b95c2a3f..4420b315c9 100644 --- a/run/test/specs/utils/permissions.ts +++ b/run/test/utils/permissions.ts @@ -5,7 +5,7 @@ import { XCUITestDriverOpts, } from 'appium-xcuitest-driver/build/lib/driver'; -import { DeviceWrapper } from '../../../types/DeviceWrapper'; +import { DeviceWrapper } from '../../types/DeviceWrapper'; import { AllowPermissionLocator, DenyPermissionLocator } from '../locators/global'; import { runScriptAndLog } from './utilities'; diff --git a/run/test/specs/utils/restore_account.ts b/run/test/utils/restore_account.ts similarity index 94% rename from run/test/specs/utils/restore_account.ts rename to run/test/utils/restore_account.ts index 289473bd54..d66f5a0472 100644 --- a/run/test/specs/utils/restore_account.ts +++ b/run/test/utils/restore_account.ts @@ -1,7 +1,7 @@ import { sleepFor } from '.'; -import { DeviceWrapper } from '../../../types/DeviceWrapper'; -import { User } from '../../../types/testing'; -import { ContinueButton } from '../../specs/locators/global'; +import { DeviceWrapper } from '../../types/DeviceWrapper'; +import { User } from '../../types/testing'; +import { ContinueButton } from '../locators/global'; import { PlusButton } from '../locators/home'; import { AccountRestoreButton, diff --git a/run/test/specs/utils/run_on.ts b/run/test/utils/run_on.ts similarity index 100% rename from run/test/specs/utils/run_on.ts rename to run/test/utils/run_on.ts diff --git a/run/test/specs/utils/screenshot_helper.ts b/run/test/utils/screenshot_helper.ts similarity index 99% rename from run/test/specs/utils/screenshot_helper.ts rename to run/test/utils/screenshot_helper.ts index a44f4c7db0..9116ff257e 100644 --- a/run/test/specs/utils/screenshot_helper.ts +++ b/run/test/utils/screenshot_helper.ts @@ -4,7 +4,7 @@ import * as fs from 'fs'; import * as path from 'path'; import sharp from 'sharp'; -import { DeviceWrapper } from '../../../types/DeviceWrapper'; +import { DeviceWrapper } from '../../types/DeviceWrapper'; import { SupportedPlatformsType } from './open_app'; // Screenshot context type diff --git a/run/test/specs/utils/set_disappearing_messages.ts b/run/test/utils/set_disappearing_messages.ts similarity index 96% rename from run/test/specs/utils/set_disappearing_messages.ts rename to run/test/utils/set_disappearing_messages.ts index e4d5dbd22d..b35ad1b257 100644 --- a/run/test/specs/utils/set_disappearing_messages.ts +++ b/run/test/utils/set_disappearing_messages.ts @@ -1,5 +1,5 @@ -import { DeviceWrapper } from '../../../types/DeviceWrapper'; -import { ConversationType, DISAPPEARING_TIMES, MergedOptions } from '../../../types/testing'; +import { DeviceWrapper } from '../../types/DeviceWrapper'; +import { ConversationType, DISAPPEARING_TIMES, MergedOptions } from '../../types/testing'; import { ConversationSettings } from '../locators/conversation'; import { DisappearingMessageRadial, diff --git a/run/test/specs/utils/sleep_for.ts b/run/test/utils/sleep_for.ts similarity index 100% rename from run/test/specs/utils/sleep_for.ts rename to run/test/utils/sleep_for.ts diff --git a/run/test/specs/utils/test_setup.ts b/run/test/utils/test_setup.ts similarity index 100% rename from run/test/specs/utils/test_setup.ts rename to run/test/utils/test_setup.ts diff --git a/run/test/specs/utils/time_travel.ts b/run/test/utils/time_travel.ts similarity index 100% rename from run/test/specs/utils/time_travel.ts rename to run/test/utils/time_travel.ts diff --git a/run/test/specs/utils/utilities.ts b/run/test/utils/utilities.ts similarity index 98% rename from run/test/specs/utils/utilities.ts rename to run/test/utils/utilities.ts index 0a33f13c09..e0461f1d70 100644 --- a/run/test/specs/utils/utilities.ts +++ b/run/test/utils/utilities.ts @@ -4,7 +4,7 @@ import { pick } from 'lodash'; import path from 'path'; import * as util from 'util'; -import { DeviceWrapper } from '../../../types/DeviceWrapper'; +import { DeviceWrapper } from '../../types/DeviceWrapper'; import { androidAppActivity, androidAppPackage } from './capabilities_android'; import { iOSBundleId } from './capabilities_ios'; import { sleepFor } from './sleep_for'; diff --git a/run/test/specs/utils/verify_screenshots.ts b/run/test/utils/verify_screenshots.ts similarity index 98% rename from run/test/specs/utils/verify_screenshots.ts rename to run/test/utils/verify_screenshots.ts index fd55916a4b..3267c72f26 100644 --- a/run/test/specs/utils/verify_screenshots.ts +++ b/run/test/utils/verify_screenshots.ts @@ -6,8 +6,8 @@ import sharp from 'sharp'; import { ssim } from 'ssim.js'; import { v4 as uuidv4 } from 'uuid'; -import { DeviceWrapper } from '../../../types/DeviceWrapper'; -import { ScreenshotFileNames } from '../../../types/testing'; +import { DeviceWrapper } from '../../types/DeviceWrapper'; +import { ScreenshotFileNames } from '../../types/testing'; import { SupportedPlatformsType } from './open_app'; import { getDiffDirectory } from './utilities'; import { clearStatusBarOverrides, setConsistentStatusBar } from './utilities'; diff --git a/run/types/DeviceWrapper.ts b/run/types/DeviceWrapper.ts index 1865470f1d..c806b7c96c 100644 --- a/run/types/DeviceWrapper.ts +++ b/run/types/DeviceWrapper.ts @@ -22,7 +22,7 @@ import { ImagePermissionsModalAllow, LocatorsInterface, ReadReceiptsButton, -} from '../../run/test/specs/locators'; +} from '../../run/test/locators'; import { profilePicture, testFile, @@ -30,7 +30,7 @@ import { testVideo, testVideoThumbnail, } from '../constants/testfiles'; -import { englishStrippedStr } from '../localizer/englishStrippedStr'; +import { tStripped } from '../localizer/lib'; import { AttachmentsButton, DocumentsFolderButton, @@ -42,7 +42,7 @@ import { OutgoingMessageStatusSent, ScrollToBottomButton, SendButton, -} from '../test/specs/locators/conversation'; +} from '../test/locators/conversation'; import { Contact, CTABody, @@ -52,27 +52,23 @@ import { CTAHeading, ModalDescription, ModalHeading, -} from '../test/specs/locators/global'; -import { ConversationItem, PlusButton } from '../test/specs/locators/home'; -import { LoadingAnimation } from '../test/specs/locators/onboarding'; +} from '../test/locators/global'; +import { ConversationItem, PlusButton } from '../test/locators/home'; +import { LoadingAnimation } from '../test/locators/onboarding'; import { PrivacyMenuItem, SaveProfilePictureButton, UserAvatar, UserSettings, VersionNumber, -} from '../test/specs/locators/settings'; -import { - EnterAccountID, - NewMessageOption, - NextButton, -} from '../test/specs/locators/start_conversation'; -import { clickOnCoordinates, sleepFor } from '../test/specs/utils'; -import { getAdbFullPath } from '../test/specs/utils/binaries'; -import { parseDataImage } from '../test/specs/utils/check_colour'; -import { isSameColor } from '../test/specs/utils/check_colour'; -import { SupportedPlatformsType } from '../test/specs/utils/open_app'; -import { isDeviceAndroid, isDeviceIOS, runScriptAndLog } from '../test/specs/utils/utilities'; +} from '../test/locators/settings'; +import { EnterAccountID, NewMessageOption, NextButton } from '../test/locators/start_conversation'; +import { clickOnCoordinates, sleepFor } from '../test/utils'; +import { getAdbFullPath } from '../test/utils/binaries'; +import { parseDataImage } from '../test/utils/check_colour'; +import { isSameColor } from '../test/utils/check_colour'; +import { SupportedPlatformsType } from '../test/utils/open_app'; +import { isDeviceAndroid, isDeviceIOS, runScriptAndLog } from '../test/utils/utilities'; import { AccessibilityId, DISAPPEARING_TIMES, @@ -2105,10 +2101,7 @@ export class DeviceWrapper { public async sendGIF(): Promise { await this.clickOnElementAll(new AttachmentsButton(this)); await this.clickOnElementAll(new GIFButton(this)); - await this.checkModalStrings( - englishStrippedStr('giphyWarning').toString(), - englishStrippedStr('giphyWarningDescription').toString() - ); + await this.checkModalStrings(tStripped('giphyWarning'), tStripped('giphyWarningDescription')); await this.clickOnByAccessibilityID('Continue', 5000); await this.clickOnElementAll(new FirstGif(this)); if (this.isIOS()) { @@ -2235,10 +2228,8 @@ export class DeviceWrapper { selector: 'Untrusted attachment message', }); await this.checkModalStrings( - englishStrippedStr(`attachmentsAutoDownloadModalTitle`).toString(), - englishStrippedStr(`attachmentsAutoDownloadModalDescription`) - .withArgs({ conversation_name: conversationName }) - .toString() + tStripped(`attachmentsAutoDownloadModalTitle`), + tStripped(`attachmentsAutoDownloadModalDescription`, { conversation_name: conversationName }) ); await this.clickOnElementAll(new DownloadMediaButton(this)); } diff --git a/run/types/sessionIt.ts b/run/types/sessionIt.ts index afaa91488d..0b1be85bbd 100644 --- a/run/types/sessionIt.ts +++ b/run/types/sessionIt.ts @@ -2,15 +2,15 @@ import { test, type TestInfo } from '@playwright/test'; import { omit } from 'lodash'; -import type { AppCountPerTest } from '../test/specs/state_builder'; +import type { AppCountPerTest } from '../test/state_builder'; -import { setupAllureTestInfo } from '../test/specs/utils/allure/allureHelpers'; -import { getNetworkTarget } from '../test/specs/utils/devnet'; -import { SupportedPlatformsType } from '../test/specs/utils/open_app'; +import { setupAllureTestInfo } from '../test/utils/allure/allureHelpers'; +import { getNetworkTarget } from '../test/utils/devnet'; +import { SupportedPlatformsType } from '../test/utils/open_app'; import { captureScreenshotsOnFailure, unregisterDevicesForTest, -} from '../test/specs/utils/screenshot_helper'; +} from '../test/utils/screenshot_helper'; import { AllureSuiteConfig } from './allure'; import { TestRisk } from './testing'; diff --git a/scripts/cleanup_ios_simulators.ts b/scripts/cleanup_ios_simulators.ts index 3871cff973..f1f11f84c2 100644 --- a/scripts/cleanup_ios_simulators.ts +++ b/scripts/cleanup_ios_simulators.ts @@ -1,7 +1,7 @@ import { execSync } from 'child_process'; import { existsSync, readFileSync, unlinkSync, writeFileSync } from 'fs'; -import type { Simulator } from '../run/test/specs/utils/capabilities_ios'; +import type { Simulator } from '../run/test/utils/capabilities_ios'; import { shutdownSimulator } from './ios_shared'; diff --git a/scripts/create_ios_simulators.ts b/scripts/create_ios_simulators.ts index 6f21fff773..5073b2323f 100644 --- a/scripts/create_ios_simulators.ts +++ b/scripts/create_ios_simulators.ts @@ -2,10 +2,10 @@ import { execSync } from 'child_process'; import { existsSync, readFileSync, writeFileSync } from 'fs'; import * as path from 'path'; -import type { Simulator } from '../run/test/specs/utils/capabilities_ios'; +import type { Simulator } from '../run/test/utils/capabilities_ios'; import type { DeviceWrapper } from '../run/types/DeviceWrapper'; -import { copyFileToSimulator } from '../run/test/specs/utils/copy_file_to_simulator'; +import { copyFileToSimulator } from '../run/test/utils/copy_file_to_simulator'; import { bootSimulator, isSimulatorBooted, shutdownSimulator } from './ios_shared'; import { sleepSync } from './shared'; From 8f2a806dc5ba7d09cf17a4fb5f3294449c605f6b Mon Sep 17 00:00:00 2001 From: Miklos Mandoki Date: Fri, 13 Feb 2026 11:37:43 +1100 Subject: [PATCH 2/2] chore: fix import paths --- run/test/specs/disappearing_community_invite.spec.ts | 2 +- run/test/specs/message_community_invitation.spec.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/run/test/specs/disappearing_community_invite.spec.ts b/run/test/specs/disappearing_community_invite.spec.ts index e604f60c34..d7c9ddcf3c 100644 --- a/run/test/specs/disappearing_community_invite.spec.ts +++ b/run/test/specs/disappearing_community_invite.spec.ts @@ -1,5 +1,6 @@ import type { TestInfo } from '@playwright/test'; +import { testCommunityLink, testCommunityName } from '../../constants/community'; import { bothPlatformsIt } from '../../types/sessionIt'; import { DISAPPEARING_TIMES } from '../../types/testing'; import { InviteContactsMenuItem } from '../locators'; @@ -15,7 +16,6 @@ import { sleepFor } from '../utils'; import { joinCommunity } from '../utils/join_community'; import { closeApp, SupportedPlatformsType } from '../utils/open_app'; import { setDisappearingMessage } from '../utils/set_disappearing_messages'; -import { testCommunityLink, testCommunityName } from './../../constants/community'; bothPlatformsIt({ title: 'Disappearing community invite message 1:1', diff --git a/run/test/specs/message_community_invitation.spec.ts b/run/test/specs/message_community_invitation.spec.ts index 34f15ba7c6..2c042042a7 100644 --- a/run/test/specs/message_community_invitation.spec.ts +++ b/run/test/specs/message_community_invitation.spec.ts @@ -1,5 +1,6 @@ import type { TestInfo } from '@playwright/test'; +import { testCommunityLink, testCommunityName } from '../../constants/community'; import { tStripped } from '../../localizer/lib'; import { bothPlatformsIt } from '../../types/sessionIt'; import { InviteContactsMenuItem, JoinCommunityModalButton } from '../locators'; @@ -14,7 +15,6 @@ import { open_Alice1_Bob1_friends } from '../state_builder'; import { sleepFor } from '../utils'; import { joinCommunity } from '../utils/join_community'; import { closeApp, SupportedPlatformsType } from '../utils/open_app'; -import { testCommunityLink, testCommunityName } from './../../constants/community'; bothPlatformsIt({ title: 'Send community invitation',