Skip to content
Snippets Groups Projects
Commit d828a1ca authored by mathias.chouet's avatar mathias.chouet
Browse files

Fix #324 - duplicate log in Remous

add e2e spec
parent 033ac520
No related branches found
No related tags found
No related merge requests found
import { AppPage } from "./app.po";
import { ListPage } from "./list.po";
import { CalculatorPage } from "./calculator.po";
import { browser } from "protractor";
import { Navbar } from "./navbar.po";
/**
* Remous
*/
describe("ngHyd − remous", () => {
let startPage: AppPage;
let listPage: ListPage;
let calcPage: CalculatorPage;
let navBar: Navbar;
beforeEach(() => {
startPage = new AppPage();
listPage = new ListPage();
calcPage = new CalculatorPage();
navBar = new Navbar();
});
it("when leaving calculated remous page then coming back to it, logs should not be duplicated", async () => {
await startPage.navigateTo();
// 1. create new Remous
await listPage.clickMenuEntryForCalcType(4);
await browser.sleep(300);
// 2. calculate it, there should be 6 messages in the log
await calcPage.getCalculateButton().click();
expect(await calcPage.nbLogEntries()).toBe(6);
await browser.sleep(300);
// 3. go to home page (simplest example)
await navBar.clickNewCalculatorButton();
await browser.sleep(300);
// 4. go back to Remous
await navBar.clickCalculatorTab(0);
await browser.sleep(300);
// 5. there should still be 6 messages in the log
expect(await calcPage.nbLogEntries()).toBe(6);
});
});
......@@ -101,7 +101,7 @@ export class RemousResults extends CalculatorResults {
this._xValues.setValues(0, Long, Dx);
}
public get log() {
public get log(): cLog {
return this._log;
}
......@@ -134,6 +134,7 @@ export class RemousResults extends CalculatorResults {
}
}
this._log.clear();
this._log.addLog(this._result.globalLog);
this._varResults = new VarResults();
......
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