Skip to content

Instantly share code, notes, and snippets.

@Watcher24
Last active September 8, 2020 07:42
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Watcher24/00b4dc7ef8e5f2c4d680d31e827c7bee to your computer and use it in GitHub Desktop.
@Test
@Fixture(fixtureFile = "website.ftl-samples-testpage.yaml", repository = "website")
@Cleanup("website:/ftl-samples-testpage")
void nestedAreas(PageObjects expect){
// GIVEN
PageEditor pageEditor = openPageEditor(expect, "/ftl-samples-testpage", "ftl-samples-testpage");
// WHEN
pageEditor.selectArea("Extras (optional)")
.selectComponent("Link List"); // -> this selection also "automatically" clicks onto edit ... which is not desired!!!
// try/catch/finally is a hack to close the unwanted form for further selection to get the nested stuff
Form form = null;
try {
form = expect.form("Dialog");
} catch (NoSuchElementException noex) {/* no need to process this ex. here*/}
finally {
if(form!=null){
form.cancel();
}
}
pageEditor.selectArea("Link List Area")
.selectComponent("External Link")
.edit();// edit directly, as if pressing the button on the green bar, instead of hitting the action bar
// THEN
expect.form();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment