Skip to content

Commit

Permalink
adding search roe delete
Browse files Browse the repository at this point in the history
works on #8
  • Loading branch information
s-laugh committed Feb 28, 2019
1 parent 84abfd7 commit d5323c6
Showing 1 changed file with 26 additions and 10 deletions.
36 changes: 26 additions & 10 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ const { AxePuppeteer } = require("axe-puppeteer");
const AxeReports = require("axe-reports");
const puppeteer = require("puppeteer");


async function a11ytest(page, name) {
const results = await new AxePuppeteer(page)
.withTags(['wcag2a','wcag2aa'])
.withTags(["wcag2a", "wcag2aa"])
.exclude([
"ul[role=menubar]" //Exlude MenuBar as it's WET and not accessible
])
Expand All @@ -22,12 +21,11 @@ async function runtest(page, name) {
}

(async () => {

const orgId = process.env.ROEWEB_ORGID;
const username = process.env.ROEWEB_UNAME;
const password = process.env.ROEWEB_PWORD;

const browser = await puppeteer.launch({ headless: true});
const browser = await puppeteer.launch({ headless: true });
console.log("Getting New Page");
const page = await browser.newPage();
console.log("Bypassing CSP");
Expand Down Expand Up @@ -57,27 +55,33 @@ async function runtest(page, name) {
await screenshot(page, "thirdpage.png");

await page.goto(
"https://srv136.services.gc.ca/ROE-RE/ROEWeb-REWeb/pro/MainMenu.aspx?org_id=" + orgId
"https://srv136.services.gc.ca/ROE-RE/ROEWeb-REWeb/pro/MainMenu.aspx?org_id=" +
orgId
);
await runtest(page, "MainMenu.aspx");

await page.goto(
"https://srv136.services.gc.ca/ROE-RE/ROEWeb-REWeb/pro/ROE/SelectBusiness?org_id=" + orgId
"https://srv136.services.gc.ca/ROE-RE/ROEWeb-REWeb/pro/ROE/SelectBusiness?org_id=" +
orgId
);
await runtest(page, "SelectBusiness");

await page.goto(
"https://srv136.services.gc.ca/ROE-RE/ROEWeb-REWeb/pro/Search/Issued?org_id=" + orgId + "&amend=True"
"https://srv136.services.gc.ca/ROE-RE/ROEWeb-REWeb/pro/Search/Issued?org_id=" +
orgId +
"&amend=True"
);
await runtest(page, "Amend");

await page.goto(
"https://srv136.services.gc.ca/ROE-RE/ROEWeb-REWeb/pro/PayrollExtract/ViewFiles?org_id=" + orgId
"https://srv136.services.gc.ca/ROE-RE/ROEWeb-REWeb/pro/PayrollExtract/ViewFiles?org_id=" +
orgId
);
await runtest(page, "ViewPayroll");

await page.goto(
"https://srv136.services.gc.ca/ROE-RE/ROEWeb-REWeb/pro/PayrollExtract/Upload?org_id=" + orgId
"https://srv136.services.gc.ca/ROE-RE/ROEWeb-REWeb/pro/PayrollExtract/Upload?org_id=" +
orgId
);
await runtest(page, "UploadPayroll");

Expand All @@ -91,10 +95,22 @@ async function runtest(page, name) {
// await runtest(page, "UploadPayrollStatus");

await page.goto(
"https://srv136.services.gc.ca/ROE-RE/ROEWeb-REWeb/pro/Requests/Prints?org_id=" + orgId
"https://srv136.services.gc.ca/ROE-RE/ROEWeb-REWeb/pro/Requests/Prints?org_id=" +
orgId
);
await runtest(page, "RequestedPrintFiles");

await page.goto(
"https://srv136.services.gc.ca/ROE-RE/ROEWeb-REWeb/pro/Delete/Search?org_id=" +
orgId
);
await runtest(page, "DeleteSearch");
//without a SN and SIN I don't know how to test this...
// await page.type("#SerialNumber", "???");
// await page.type("#SIN", "???");
// await page.click("button[type=submit]");
// await page.waitForNavigation();
// await runtest(page, "DeleteSearchStatus");

await page.close();
await browser.close();
Expand Down

0 comments on commit d5323c6

Please sign in to comment.