Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

test(update): update settings about test to include made in #581

Merged
merged 1 commit into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion tests/screenobjects/settings/SettingsAboutScreen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ const SELECTORS_COMMON = {};
const SELECTORS_WINDOWS = {
ABOUT_SECTION: '//Group[@Name="settings-section"][1]',
CHECK_FOR_UPDATES_BUTTON: '[name="check-for-updates-button"]',
MADE_IN_SECTION: '//Group[@Name="settings-section"][5]',
OPEN_SOURCE_CODE_SECTION: '//Group[@Name="settings-section"][4]',
OPEN_WEBSITE_SECTION: '//Group[@Name="settings-section"][3]',
VERSION_SECTION: '//Group[@Name="settings-section"][2]',
OPEN_SOURCE_CODE_BUTTON: '[name="open-codebase-button"]',
OPEN_WEBSITE_BUTTON: '[name="open-website-button"]',
SETTINGS_CONTROL: '[name="settings-control"]',
SETTINGS_CONTROL_CHECKBOX: '[name="switch-slider-value"]',
SETTINGS_CONTROL_TEXT: "<Text>",
SETTINGS_INFO: '[name="settings-info"]',
SETTINGS_INFO_DESCRIPTION: "<Text>[2]",
SETTINGS_INFO_HEADER: "//Text[1]/Text",
Expand All @@ -26,16 +28,19 @@ const SELECTORS_MACOS = {
ABOUT_SECTION:
'-ios class chain:**/XCUIElementTypeGroup[`label == "settings-section"`][1]',
CHECK_FOR_UPDATES_BUTTON: "~check-for-updates-button",
MADE_IN_SECTION:
'-ios class chain:**/XCUIElementTypeGroup[`label == "settings-section"`][4]',
OPEN_SOURCE_CODE_SECTION:
'-ios class chain:**/XCUIElementTypeGroup[`label == "settings-section"`][3]',
OPEN_WEBSITE_SECTION:
'-ios class chain:**/XCUIElementTypeGroup[`label == "settings-section"`][2]',
VERSION_SECTION:
'-ios class chain:**/XCUIElementTypeGroup[`label == "settings-section"`][4]',
'-ios class chain:**/XCUIElementTypeGroup[`label == "settings-section"`][5]',
OPEN_SOURCE_CODE_BUTTON: "~open-codebase-button",
OPEN_WEBSITE_BUTTON: "~open-website-button",
SETTINGS_CONTROL: "~settings-control",
SETTINGS_CONTROL_CHECKBOX: "~switch-slider-value",
SETTINGS_CONTROL_TEXT: "-ios class chain:**/XCUIElementTypeStaticText",
SETTINGS_INFO: "~settings-info",
SETTINGS_INFO_DESCRIPTION:
"-ios class chain:**/XCUIElementTypeGroup/XCUIElementTypeStaticText",
Expand Down Expand Up @@ -63,6 +68,24 @@ export default class SettingsAboutScreen extends SettingsBaseScreen {
.$(SELECTORS.SETTINGS_INFO_HEADER);
}

get madeInDescription() {
return $(SELECTORS.MADE_IN_SECTION)
.$(SELECTORS.SETTINGS_INFO)
.$(SELECTORS.SETTINGS_INFO_DESCRIPTION);
}

get madeInHeader() {
return $(SELECTORS.MADE_IN_SECTION)
.$(SELECTORS.SETTINGS_INFO)
.$(SELECTORS.SETTINGS_INFO_HEADER);
}

get madeInText() {
return $(SELECTORS.MADE_IN_SECTION)
.$(SELECTORS.SETTINGS_CONTROL)
.$(SELECTORS.SETTINGS_CONTROL_TEXT);
}

get checkForUpdatesButton() {
return $(SELECTORS.CHECK_FOR_UPDATES_BUTTON);
}
Expand Down
10 changes: 10 additions & 0 deletions tests/specs/11-settings-about.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ export default async function settingsAbout() {
await expect(openSourceDescription).toHaveTextContaining(
"Opens the codebase in your default web browser.",
);

// Validate the header and description texts from Settings Section - About - MadeIn
const madeInHeader = await settingsAboutFirstUser.madeInHeader;
const madeInDescription = await settingsAboutFirstUser.madeInDescription;
const madeInText = await settingsAboutFirstUser.madeInText;
await expect(madeInHeader).toHaveTextContaining("MADE IN");
await expect(madeInDescription).toHaveTextContaining(
"Our team is all over the world with different backgrounds and day-to-day lives, all working on a common goal to build Uplink & Satellite together.",
);
await expect(madeInText).toHaveTextContaining("๐Ÿ‡บ๐Ÿ‡ธ๐Ÿ‡ฒ๐Ÿ‡ฝ๐Ÿ‡ฉ๐Ÿ‡ช๐Ÿ‡ต๐Ÿ‡น๐Ÿ‡ง๐Ÿ‡ท๐Ÿ‡ฎ๐Ÿ‡น๐Ÿ‡บ๐Ÿ‡ฆ๐Ÿ‡ง๐Ÿ‡พ๐Ÿ‡ฏ๐Ÿ‡ต๐Ÿ‡ฆ๐Ÿ‡บ๐Ÿ‡ฎ๐Ÿ‡ฉ");
});

// Test skipped since we need to research on how to return properly to the app before implementing this test
Expand Down
Loading