From 7b4d97f900b4b9e5fe7b5c8ca147b0cbc792a9ae Mon Sep 17 00:00:00 2001 From: thaddmt <68032955+thaddmt@users.noreply.github.com> Date: Wed, 11 Sep 2024 14:56:08 -0700 Subject: [PATCH] fix(e2e): fix placeholder matching rn e2e android (#5793) --- packages/e2e/detox/integration/common/shared.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/e2e/detox/integration/common/shared.ts b/packages/e2e/detox/integration/common/shared.ts index 7fdf95ca45f..6908b99c03b 100644 --- a/packages/e2e/detox/integration/common/shared.ts +++ b/packages/e2e/detox/integration/common/shared.ts @@ -93,7 +93,18 @@ Then( ); Then('I see placeholder {string}', async (placeholder: string) => { - await expect(element(by.text(placeholder))).toExist(); + const emailField = element( + by.id('authenticator__text-field__input-username') + ); + await expect(emailField).toExist(); + const attributes = await emailField.getAttributes(); + if ((attributes as Detox.ElementAttributes).placeholder) { + if ((attributes as any).placeholder !== placeholder) { + throw new Error( + `No element found with placeholder value: ${placeholder}` + ); + } + } }); Then(