Skip to content

Commit

Permalink
screenobject(update): fix send files button validation
Browse files Browse the repository at this point in the history
  • Loading branch information
luisecm committed Nov 14, 2023
1 parent 89fdc66 commit 6cdcbce
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions tests/screenobjects/chats/SendFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ const SELECTORS_MACOS = {
FILES_LIST: "~files-list",
GO_TO_FILES_BUTTON: "~go_to_files_btn",
HOME_DIR: "~home-dir",
HOME_DIR_TEXT: "~Home",
HOME_DIR_TEXT:
'-ios class chain:**/XCUIElementTypeStaticText[`value == "Home"`]',
INPUT_ERROR: "~input-error",
INPUT_ERROR_TEXT: "-ios class chain:**/XCUIElementTypeStaticText",
INPUT_FILE_NAME: '[name="file-name-input"]',
Expand Down Expand Up @@ -212,8 +213,6 @@ export default class SendFiles extends UplinkMainScreen {
let result;
if (currentDriver === WINDOWS_DRIVER) {
result = await sendFilesModalSendButton.getAttribute("HelpText");
} else {
result = await sendFilesModalSendButton.getAttribute("placeholderValue");
}
return result.toString();
}
Expand All @@ -234,7 +233,7 @@ export default class SendFiles extends UplinkMainScreen {
const folders = await this.filesCrumb;
const treeLength = folders.length - 1;
const currentFolderName = await folders[treeLength].$(
SELECTORS.FILES_CRUMB_TEXT
SELECTORS.FILES_CRUMB_TEXT,
);
const currentFolderNameText = await currentFolderName.getText();
return currentFolderNameText;
Expand Down Expand Up @@ -306,9 +305,12 @@ export default class SendFiles extends UplinkMainScreen {
}

async validateSendFilesButtonText(expectedText: string) {
await this.getValueFromSendFilesButton().then((value) => {
expect(value).toEqual(expectedText);
});
const currentDriver = await this.getCurrentDriver();
if (currentDriver === WINDOWS_DRIVER) {
await this.getValueFromSendFilesButton().then((value) => {
expect(value).toEqual(expectedText);
});
}
}

async validateSendFilesModalIsShown() {
Expand Down

0 comments on commit 6cdcbce

Please sign in to comment.