Fix diagnostics tests (#1456)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
This commit is contained in:
@@ -18,18 +18,15 @@ import * as roles from "../utils/roles";
|
|||||||
import * as elements from "../utils/elements";
|
import * as elements from "../utils/elements";
|
||||||
import { diagnosticsElement, supportElement } from "../utils/elements-menu";
|
import { diagnosticsElement, supportElement } from "../utils/elements-menu";
|
||||||
|
|
||||||
fixture("For user with Diagnostics permissions")
|
fixture("For user with Diagnostics permissions").page("http://localhost:9090");
|
||||||
.page("http://localhost:9090")
|
|
||||||
.beforeEach(async (t) => {
|
|
||||||
await t.useRole(roles.diagnostics);
|
|
||||||
});
|
|
||||||
|
|
||||||
test("Support sidebar item exists", async (t) => {
|
test("Support sidebar item exists", async (t) => {
|
||||||
await t.expect(supportElement.exists).ok();
|
await t.useRole(roles.diagnostics).expect(supportElement.exists).ok();
|
||||||
});
|
});
|
||||||
|
|
||||||
test("Diagnostics link exists in Tools page", async (t) => {
|
test("Diagnostics link exists in Tools page", async (t) => {
|
||||||
await t
|
await t
|
||||||
|
.useRole(roles.diagnostics)
|
||||||
.expect(supportElement.exists)
|
.expect(supportElement.exists)
|
||||||
.ok()
|
.ok()
|
||||||
.click(supportElement)
|
.click(supportElement)
|
||||||
@@ -38,12 +35,15 @@ test("Diagnostics link exists in Tools page", async (t) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("Diagnostics page can be opened", async (t) => {
|
test("Diagnostics page can be opened", async (t) => {
|
||||||
await t.navigateTo("http://localhost:9090/support/diagnostics");
|
await t
|
||||||
|
.useRole(roles.diagnostics)
|
||||||
|
.navigateTo("http://localhost:9090/support/diagnostics");
|
||||||
});
|
});
|
||||||
|
|
||||||
test("Start Diagnostic button exists", async (t) => {
|
test("Start Diagnostic button exists", async (t) => {
|
||||||
const startDiagnosticExists = elements.startDiagnosticButton.exists;
|
const startDiagnosticExists = elements.startDiagnosticButton.exists;
|
||||||
await t
|
await t
|
||||||
|
.useRole(roles.diagnostics)
|
||||||
.navigateTo("http://localhost:9090/support/diagnostics")
|
.navigateTo("http://localhost:9090/support/diagnostics")
|
||||||
.expect(startDiagnosticExists)
|
.expect(startDiagnosticExists)
|
||||||
.ok();
|
.ok();
|
||||||
@@ -51,37 +51,45 @@ test("Start Diagnostic button exists", async (t) => {
|
|||||||
|
|
||||||
test("Start Diagnostic button can be clicked", async (t) => {
|
test("Start Diagnostic button can be clicked", async (t) => {
|
||||||
await t
|
await t
|
||||||
|
.useRole(roles.diagnostics)
|
||||||
.navigateTo("http://localhost:9090/support/diagnostics")
|
.navigateTo("http://localhost:9090/support/diagnostics")
|
||||||
.click(elements.startDiagnosticButton);
|
.click(elements.startDiagnosticButton);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("Download button exists after Diagnostic is completed", async (t) => {
|
test("Download button exists after Diagnostic is completed", async (t) => {
|
||||||
const downloadExists = elements.downloadButton.exists;
|
|
||||||
await t
|
await t
|
||||||
|
.useRole(roles.diagnostics)
|
||||||
.navigateTo("http://localhost:9090/support/diagnostics")
|
.navigateTo("http://localhost:9090/support/diagnostics")
|
||||||
.click(elements.startDiagnosticButton)
|
.click(elements.startDiagnosticButton)
|
||||||
.expect(downloadExists)
|
.wait(2000)
|
||||||
|
.expect(elements.downloadButton.exists)
|
||||||
.ok();
|
.ok();
|
||||||
});
|
});
|
||||||
|
|
||||||
test("Download button is clickable after Diagnostic is completed", async (t) => {
|
test("Download button is clickable after Diagnostic is completed", async (t) => {
|
||||||
await t
|
await t
|
||||||
|
.useRole(roles.diagnostics)
|
||||||
.navigateTo("http://localhost:9090/support/diagnostics")
|
.navigateTo("http://localhost:9090/support/diagnostics")
|
||||||
.click(elements.startDiagnosticButton)
|
.click(elements.startDiagnosticButton)
|
||||||
|
.wait(2000)
|
||||||
.click(elements.downloadButton);
|
.click(elements.downloadButton);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("Start New Diagnostic button exists after Diagnostic is completed", async (t) => {
|
test("Start New Diagnostic button exists after Diagnostic is completed", async (t) => {
|
||||||
await t
|
await t
|
||||||
|
.useRole(roles.diagnostics)
|
||||||
.navigateTo("http://localhost:9090/support/diagnostics")
|
.navigateTo("http://localhost:9090/support/diagnostics")
|
||||||
.click(elements.startDiagnosticButton)
|
.click(elements.startDiagnosticButton)
|
||||||
|
.wait(2000)
|
||||||
.expect(elements.startNewDiagnosticButton.exists)
|
.expect(elements.startNewDiagnosticButton.exists)
|
||||||
.ok();
|
.ok();
|
||||||
});
|
});
|
||||||
|
|
||||||
test("Start New Diagnostic button is clickable after Diagnostic is completed", async (t) => {
|
test("Start New Diagnostic button is clickable after Diagnostic is completed", async (t) => {
|
||||||
await t
|
await t
|
||||||
|
.useRole(roles.diagnostics)
|
||||||
.navigateTo("http://localhost:9090/support/diagnostics")
|
.navigateTo("http://localhost:9090/support/diagnostics")
|
||||||
.click(elements.startDiagnosticButton)
|
.click(elements.startDiagnosticButton)
|
||||||
|
.wait(2000)
|
||||||
.click(elements.startNewDiagnosticButton);
|
.click(elements.startNewDiagnosticButton);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user