Skip to content

Commit

Permalink
test(update): fix settings audio tests
Browse files Browse the repository at this point in the history
  • Loading branch information
luisecm committed Dec 14, 2023
1 parent eb9ffb0 commit 70d52bd
Showing 1 changed file with 44 additions and 24 deletions.
68 changes: 44 additions & 24 deletions tests/screenobjects/settings/SettingsAudioScreen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const SELECTORS_COMMON = {
};

const SELECTORS_WINDOWS = {
BUTTON: "<Button>",
DROPDOWN_MENU: "<ComboBox>",
DROPDOWN_OPTION: '[name="Selector Option"]',
SETTINGS_CONTROL: '[name="settings-control"]',
Expand All @@ -31,6 +32,7 @@ const SELECTORS_WINDOWS = {
};

const SELECTORS_MACOS = {
BUTTON: "-ios class chain:**/XCUIElementTypeButton",
DROPDOWN_MENU: "~Selector",
DROPDOWN_OPTION: "~Selector Option",
SETTINGS_CONTROL: "~settings-control",
Expand All @@ -57,52 +59,52 @@ export default class SettingsAudioScreen extends SettingsBaseScreen {

get callTimerCheckbox() {
return this.instance
.$$(SELECTORS.SETTINGS_SECTION)[6]
.$$(SELECTORS.SETTINGS_SECTION)[8]
.$(SELECTORS.SWITCH_SLIDER);
}

get callTimerControllerValue() {
return this.instance
.$$(SELECTORS.SETTINGS_SECTION)[6]
.$$(SELECTORS.SETTINGS_SECTION)[8]
.$(SELECTORS.SETTINGS_CONTROL_CHECKBOX);
}

get callTimerDescription() {
return this.instance
.$$(SELECTORS.SETTINGS_SECTION)[6]
.$$(SELECTORS.SETTINGS_SECTION)[8]
.$(SELECTORS.SETTINGS_INFO)
.$(SELECTORS.SETTINGS_INFO_DESCRIPTION);
}

get callTimerHeader() {
return this.instance
.$$(SELECTORS.SETTINGS_SECTION)[6]
.$$(SELECTORS.SETTINGS_SECTION)[8]
.$(SELECTORS.SETTINGS_INFO)
.$(SELECTORS.SETTINGS_INFO_HEADER);
}

get echoCancellationCheckbox() {
return this.instance
.$$(SELECTORS.SETTINGS_SECTION)[2]
.$$(SELECTORS.SETTINGS_SECTION)[4]
.$(SELECTORS.SWITCH_SLIDER);
}

get echoCancellationControllerValue() {
return this.instance
.$$(SELECTORS.SETTINGS_SECTION)[2]
.$$(SELECTORS.SETTINGS_SECTION)[4]
.$(SELECTORS.SETTINGS_CONTROL_CHECKBOX);
}

get echoCancellationDescription() {
return this.instance
.$$(SELECTORS.SETTINGS_SECTION)[2]
.$$(SELECTORS.SETTINGS_SECTION)[4]
.$(SELECTORS.SETTINGS_INFO)
.$(SELECTORS.SETTINGS_INFO_DESCRIPTION);
}

get echoCancellationHeader() {
return this.instance
.$$(SELECTORS.SETTINGS_SECTION)[2]
.$$(SELECTORS.SETTINGS_SECTION)[4]
.$(SELECTORS.SETTINGS_INFO)
.$(SELECTORS.SETTINGS_INFO_HEADER);
}
Expand Down Expand Up @@ -134,111 +136,119 @@ export default class SettingsAudioScreen extends SettingsBaseScreen {
.$(SELECTORS.SETTINGS_INFO_HEADER);
}

get inputDeviceTestButton() {
return this.instance.$$(SELECTORS.SETTINGS_SECTION)[1].$(SELECTORS.BUTTON);
}

get interfaceSoundsCheckbox() {
return this.instance
.$$(SELECTORS.SETTINGS_SECTION)[3]
.$$(SELECTORS.SETTINGS_SECTION)[5]
.$(SELECTORS.SWITCH_SLIDER);
}

get interfaceSoundsControllerValue() {
return this.instance
.$$(SELECTORS.SETTINGS_SECTION)[3]
.$$(SELECTORS.SETTINGS_SECTION)[5]
.$(SELECTORS.SETTINGS_CONTROL_CHECKBOX);
}

get interfaceSoundsDescription() {
return this.instance
.$$(SELECTORS.SETTINGS_SECTION)[3]
.$$(SELECTORS.SETTINGS_SECTION)[5]
.$(SELECTORS.SETTINGS_INFO)
.$(SELECTORS.SETTINGS_INFO_DESCRIPTION);
}

get interfaceSoundsHeader() {
return this.instance
.$$(SELECTORS.SETTINGS_SECTION)[3]
.$$(SELECTORS.SETTINGS_SECTION)[5]
.$(SELECTORS.SETTINGS_INFO)
.$(SELECTORS.SETTINGS_INFO_HEADER);
}

get mediaSoundsCheckbox() {
return this.instance
.$$(SELECTORS.SETTINGS_SECTION)[4]
.$$(SELECTORS.SETTINGS_SECTION)[6]
.$(SELECTORS.SWITCH_SLIDER);
}

get mediaSoundsControllerValue() {
return this.instance
.$$(SELECTORS.SETTINGS_SECTION)[4]
.$$(SELECTORS.SETTINGS_SECTION)[6]
.$(SELECTORS.SETTINGS_CONTROL_CHECKBOX);
}

get mediaSoundsDescription() {
return this.instance
.$$(SELECTORS.SETTINGS_SECTION)[4]
.$$(SELECTORS.SETTINGS_SECTION)[6]
.$(SELECTORS.SETTINGS_INFO)
.$(SELECTORS.SETTINGS_INFO_DESCRIPTION);
}

get mediaSoundsHeader() {
return this.instance
.$$(SELECTORS.SETTINGS_SECTION)[4]
.$$(SELECTORS.SETTINGS_SECTION)[6]
.$(SELECTORS.SETTINGS_INFO)
.$(SELECTORS.SETTINGS_INFO_HEADER);
}

get messageSoundsCheckbox() {
return this.instance
.$$(SELECTORS.SETTINGS_SECTION)[5]
.$$(SELECTORS.SETTINGS_SECTION)[7]
.$(SELECTORS.SWITCH_SLIDER);
}

get messageSoundsControllerValue() {
return this.instance
.$$(SELECTORS.SETTINGS_SECTION)[5]
.$$(SELECTORS.SETTINGS_SECTION)[7]
.$(SELECTORS.SETTINGS_CONTROL_CHECKBOX);
}

get messageSoundsDescription() {
return this.instance
.$$(SELECTORS.SETTINGS_SECTION)[5]
.$$(SELECTORS.SETTINGS_SECTION)[7]
.$(SELECTORS.SETTINGS_INFO)
.$(SELECTORS.SETTINGS_INFO_DESCRIPTION);
}

get messageSoundsHeader() {
return this.instance
.$$(SELECTORS.SETTINGS_SECTION)[5]
.$$(SELECTORS.SETTINGS_SECTION)[7]
.$(SELECTORS.SETTINGS_INFO)
.$(SELECTORS.SETTINGS_INFO_HEADER);
}

get outputDeviceDescription() {
return this.instance
.$$(SELECTORS.SETTINGS_SECTION)[1]
.$$(SELECTORS.SETTINGS_SECTION)[2]
.$(SELECTORS.SETTINGS_INFO)
.$(SELECTORS.SETTINGS_INFO_DESCRIPTION);
}

get outputDeviceDropdown() {
return this.instance
.$$(SELECTORS.SETTINGS_SECTION)[1]
.$$(SELECTORS.SETTINGS_SECTION)[2]
.$(SELECTORS.DROPDOWN_MENU);
}

get outputDeviceDropdownOption() {
return this.instance
.$$(SELECTORS.SETTINGS_SECTION)[1]
.$$(SELECTORS.SETTINGS_SECTION)[2]
.$(SELECTORS.DROPDOWN_MENU)
.$$(SELECTORS.DROPDOWN_OPTION);
}

get outputDeviceHeader() {
return this.instance
.$$(SELECTORS.SETTINGS_SECTION)[1]
.$$(SELECTORS.SETTINGS_SECTION)[2]
.$(SELECTORS.SETTINGS_INFO)
.$(SELECTORS.SETTINGS_INFO_HEADER);
}

get outputDeviceTestButton() {
return this.instance.$$(SELECTORS.SETTINGS_SECTION)[3].$(SELECTORS.BUTTON);
}

get settingsAudio() {
return this.instance.$(SELECTORS.SETTINGS_AUDIO);
}
Expand All @@ -250,6 +260,11 @@ export default class SettingsAudioScreen extends SettingsBaseScreen {
await inputDeviceDropdown.click();
}

async clickOnInputDeviceTestButton() {
const inputDeviceTestButton = await this.inputDeviceTestButton;
await inputDeviceTestButton.click();
}

async clickOnCallTimer() {
const currentDriver = await this.getCurrentDriver();
const callTimerCheckbox = await this.callTimerCheckbox;
Expand Down Expand Up @@ -305,6 +320,11 @@ export default class SettingsAudioScreen extends SettingsBaseScreen {
await outputDeviceDropdown.click();
}

async clickOnOutputDeviceTestButton() {
const outputDeviceTestButton = await this.outputDeviceTestButton;
await outputDeviceTestButton.click();
}

// Input, Output and Sample Rate selection methods

async selectInputDevice(device: string) {
Expand Down

0 comments on commit 70d52bd

Please sign in to comment.