Skip to content

Commit

Permalink
screenobject(update): improving chat message locators
Browse files Browse the repository at this point in the history
  • Loading branch information
luisecm committed Mar 1, 2024
1 parent e4c16a6 commit 5805b1a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
12 changes: 4 additions & 8 deletions tests/screenobjects/chats/MessageLocal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,16 +243,12 @@ export default class MessageLocal extends UplinkMainScreen {
await driver.waitUntil(
async () => {
if (currentDriver === MACOS_DRIVER) {
return await $(
'-ios class chain:**/XCUIElementTypeGroup[`label BEGINSWITH "message-text"`]/**/XCUIElementTypeStaticText[`value BEGINSWITH "' +
expectedMessage +
'"`]',
).waitForExist({ reverse: true });
return await $(`~message-text-${expectedMessage}`).waitForExist({
reverse: true,
});
} else if (currentDriver === WINDOWS_DRIVER) {
return await $(
'//Group[contains(@Name, "message-text")]//Text[contains(@Name, "' +
expectedMessage +
'")]',
`[name="message-text-${expectedMessage}"]`,
).waitForExist({ reverse: true });
}
},
Expand Down
12 changes: 4 additions & 8 deletions tests/screenobjects/chats/MessageRemote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,16 +321,12 @@ export default class MessageRemote extends UplinkMainScreen {
await driver.waitUntil(
async () => {
if (currentDriver === MACOS_DRIVER) {
return await $(
'-ios class chain:**/XCUIElementTypeGroup[`label BEGINSWITH "message-text"`]/**/XCUIElementTypeStaticText[`value BEGINSWITH "' +
expectedMessage +
'"`]',
).waitForExist({ reverse: true });
return await $(`~message-text-${expectedMessage}`).waitForExist({
reverse: true,
});
} else if (currentDriver === WINDOWS_DRIVER) {
return await $(
'//Group[contains(@Name, "message-text")]//Text[contains(@Name, "' +
expectedMessage +
'")]',
`[name="message-text-${expectedMessage}"]`,
).waitForExist({ reverse: true });
}
},
Expand Down

0 comments on commit 5805b1a

Please sign in to comment.