Skip to content
Snippets Groups Projects
Commit 81b39985 authored by François Grand's avatar François Grand
Browse files

test(e2e): check that notes are displayed properly

refs #602
parent b141bf1f
No related branches found
No related tags found
2 merge requests!225Release v4.17.0,!204Resolve "Notes de session : la note ne s'affiche pas directement"
import { browser, by, element } from "protractor";
import { AppPage } from "./app.po";
import { Navbar } from "./navbar.po";
import { ListPage } from "./list.po";
import { SideNav } from "./sidenav.po";
describe("check calculator notes", () => {
let startPage: AppPage;
let navBar: Navbar;
let listPage: ListPage;
let sidenav: SideNav;
beforeEach(() => {
startPage = new AppPage();
navBar = new Navbar();
listPage = new ListPage();
sidenav = new SideNav();
});
it(" - notes should display properly when opened from a calculator", async () => {
await startPage.navigateTo();
await browser.sleep(200);
// open PAB: chute calculator
await listPage.clickMenuEntryForCalcType(12);
await browser.sleep(200);
// open notes
await navBar.clickMenuButton();
await browser.sleep(200);
await sidenav.clickNotesButton();
await browser.sleep(200);
// input some text
const ta = element(by.css("textarea"));
await ta.clear();
await ta.sendKeys("azerty123");
await browser.sleep(200);
// reopen calculator
await navBar.openNthCalculator(0);
await browser.sleep(200);
// reopen notes
await navBar.clickMenuButton();
await browser.sleep(200);
await sidenav.clickNotesButton();
await browser.sleep(200);
// check text
const md = element(by.css("markdown p"));
await browser.sleep(200);
expect(await md.getText()).toEqual("azerty123");
});
it(" - notes should display properly when opened from modules diagram", async () => {
await startPage.navigateTo();
await browser.sleep(200);
// open PAB: chute calculator
await listPage.clickMenuEntryForCalcType(12);
await browser.sleep(200);
// open notes
await navBar.clickMenuButton();
await browser.sleep(200);
await sidenav.clickNotesButton();
await browser.sleep(200);
// input some text
const ta = element(by.css("textarea"));
await ta.clear();
await ta.sendKeys("azerty123");
await browser.sleep(200);
// open modules diagram
await navBar.clickMenuButton();
await browser.sleep(200);
await sidenav.clickDiagramButton();
await browser.sleep(200);
// open notes
const notesLink = element(by.css("#show-notes a"));
notesLink.click();
await browser.sleep(200);
// check text
const md = element(by.css("markdown p"));
await browser.sleep(200);
expect(await md.getText()).toEqual("azerty123");
});
});
......@@ -31,6 +31,10 @@ export class SideNav {
return element(by.css(`button#confirm-new-session`));
}
getNotesButton() {
return element(by.css("#side-nav-session-props"));
}
async clickLoadSessionButton() {
const ncb = this.getLoadSessionButton();
await browser.sleep(500);
......@@ -60,4 +64,10 @@ export class SideNav {
await this.getFileLoadButton().click();
}
}
async clickNotesButton() {
const nb = this.getNotesButton();
await browser.sleep(200);
await nb.click();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment