Skip to content

Instantly share code, notes, and snippets.

@Watcher24
Created June 30, 2022 06:06
Show Gist options
  • Save Watcher24/b222338cfffc49291a86ea41e28630f7 to your computer and use it in GitHub Desktop.
Save Watcher24/b222338cfffc49291a86ea41e28630f7 to your computer and use it in GitHub Desktop.
package it.info.magnolia.test.selenium.pageobjects;
import static org.junit.jupiter.api.Assertions.assertFalse;
import info.magnolia.test.selenium.Personas;
import info.magnolia.test.selenium.Selenium;
import info.magnolia.test.selenium.pageobjects.PageObjects;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
@ExtendWith(Selenium.class)
class AppLauncherTest {
@Test
void openApp(PageObjects expect) {
// GIVEN
expect.loginPage()
.login(Personas.ARMIN);
expect.findBar().
clickAppLauncherButton();
// WHEN
expect.appLauncher()
.openApp("Security");
// THEN
expect.contentApp("Users");
}
@Test
void nonSuperuserCannotAccessSecurityApp(PageObjects expect) {
// GIVEN
// TODO replace with pablo or other provided user once DEV-1283 is resolved.
expect.loginPage()
.login(Personas.ERIC);
// WHEN
expect.findBar()
.clickAppLauncherButton();
// THEN
assertFalse(expect.appLauncher().hasApp("Security"));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment