Skip to content

Commit

Permalink
test: update how back button is selected in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
porcellus committed Oct 30, 2023
1 parent e61dd45 commit 85b1c4d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions test/end-to-end/resetpasswordusingtoken.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import {
defaultSignUp,
screenshotOnFailure,
getAuthPageHeaderText,
getResetPasswordFormBackButton,
getTitleBackButton,
waitForSTElement,
getResetPasswordSuccessBackToSignInButton,
backendBeforeEach,
Expand Down Expand Up @@ -117,7 +117,7 @@ describe("SuperTokens Reset password", function () {
});

it("Should redirect to Sign In screen when back button is clicked", async function () {
const backButton = await getResetPasswordFormBackButton(page);
const backButton = await getTitleBackButton(page);

await backButton.click();

Expand Down
5 changes: 2 additions & 3 deletions test/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -786,9 +786,8 @@ export function isReact16() {
return process.env.IS_REACT_16 === "true";
}

export async function getResetPasswordFormBackButton(page) {
const backButtonSelector =
"[data-supertokens='headerTitle resetPasswordHeaderTitle'] > [data-supertokens='backButton backButtonCommon']";
export async function getTitleBackButton(page) {
const backButtonSelector = "[data-supertokens='headerTitle'] > [data-supertokens='backButton backButtonCommon']";

return await waitForSTElement(page, backButtonSelector);
}
Expand Down

0 comments on commit 85b1c4d

Please sign in to comment.