Skip to content
Snippets Groups Projects
Commit 56e78450 authored by Dorchies David's avatar Dorchies David
Browse files

Merge branch '602-notes-de-session-la-note-ne-s-affiche-pas-directement' into 'devel'

Resolve "Notes de session : la note ne s'affiche pas directement"

Closes #602

See merge request !204
parents 582d4266 fa050910
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"
Pipeline #140232 passed
......@@ -49,7 +49,8 @@
],
"scripts": [
"node_modules/marked/marked.min.js",
"node_modules/katex/dist/katex.min.js"
"node_modules/katex/dist/katex.min.js",
"node_modules/katex/dist/contrib/auto-render.min.js"
],
"allowedCommonJsDependencies": [
"chartjs-plugin-zoom",
......
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();
}
}
......@@ -14,8 +14,8 @@
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#ffffff">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="manifest" href="manifest.webmanifest">
<meta name="theme-color" content="#1976d2">
<link rel="manifest" href="manifest.webmanifest">
<meta name="theme-color" content="#1976d2">
</head>
<body>
......@@ -163,4 +163,4 @@
<noscript>Please enable JavaScript to continue using this application.</noscript>
</body>
</html>
\ No newline at end of file
</html>
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