Skip to content

Commit

Permalink
Add e2e tests for global settings label #1715
Browse files Browse the repository at this point in the history
  • Loading branch information
JaiJoPa committed Mar 24, 2021
1 parent c7e6507 commit 8ea01cb
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { goto } from "../../../puppeteer.helper"
import { FileChooserPageObject } from "../fileChooser/fileChooser.po"
import { DialogGlobalSettingsPageObject } from "./dialog.globalSettings.po"

describe("LegendPanel", () => {
let globalSettingsPageObject: DialogGlobalSettingsPageObject
let fileChooser: FileChooserPageObject

beforeEach(async () => {
globalSettingsPageObject = new DialogGlobalSettingsPageObject()
fileChooser = new FileChooserPageObject()

await goto()
await setupTest()
})

async function setupTest() {
await fileChooser.openFiles(["./app/codeCharta/ressources/sample1_with_different_edges.cc.json"])
await globalSettingsPageObject.openGlobalSettings()
}

describe("GlobalSettings", () => {
it("Should contain the label for the map layout", async () => {
const label = await globalSettingsPageObject.getMapLayoutLabel()
expect(label).toEqual("Map Layout")
})
it("Should contain the Display quality Layout", async () => {
const label = await globalSettingsPageObject.getDisplayQualityLabel()
expect(label).toEqual("Display quality")
})
/*
it("Should change the layout algorithm", async () => {
globalSettingsPageObject.changeLayout()
globalSettingsPageObject.setStreetMapAsLayout()
const label = await globalSettingsPageObject.getLayout()
console.log("this.is.it ", label)
})
*/
})
})
16 changes: 16 additions & 0 deletions visualization/app/codeCharta/ui/dialog/dialog.globalSettings.po.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { clickButtonOnPageElement } from "../../../puppeteer.helper"

export class DialogGlobalSettingsPageObject {
async openGlobalSettings() {
await clickButtonOnPageElement("global-settings-button-component .toolbar-button")
await page.waitForSelector("md-dialog.global-settings")
}

async getMapLayoutLabel() {
return page.$eval("layout-selection-component > div > md-input-container > label", element => element["innerText"])
}

async getDisplayQualityLabel() {
return page.$eval("sharpness-mode-selector-component > div > md-input-container > label", element => element["innerText"])
}
}

0 comments on commit 8ea01cb

Please sign in to comment.