mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-07 02:28:11 +08:00
create e2e test for auth buttons (#1907)
This PR adds a few helpful additions regarding authentication. Changes: * e2e tests are now run on test_oauth via a passed config.yaml * node dev server correctly handles `/login` and `/logout` endpoints to make developing for auth easier * Introduced auth e2e tests to check that buttons display and work
This commit is contained in:
@@ -322,7 +322,7 @@ export async function login() {
|
||||
|
||||
await goToPage(appUrlBase);
|
||||
|
||||
await clickOn("auth-button");
|
||||
await clickOn("log-in");
|
||||
|
||||
// (thuang): Auth0 form is unstable and unsafe for input until verified
|
||||
await waitUntilFormFieldStable('[name="email"]');
|
||||
@@ -341,16 +341,15 @@ export async function login() {
|
||||
}
|
||||
|
||||
export async function logout() {
|
||||
await clickOnUntil("menu", async () => {
|
||||
await expect(page).toMatch("Log Out");
|
||||
|
||||
await clickOnUntil("user-info", async () => {
|
||||
await waitByID("log-out");
|
||||
await Promise.all([
|
||||
page.waitForNavigation({ waitUntil: "networkidle0" }),
|
||||
expect(page).toClick("a", { text: "Log Out" }),
|
||||
clickOn("log-out"),
|
||||
]);
|
||||
});
|
||||
|
||||
await expect(page).toMatch("Log In");
|
||||
await waitByID("log-in");
|
||||
}
|
||||
|
||||
async function waitUntilFormFieldStable(selector) {
|
||||
|
||||
Reference in New Issue
Block a user