This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.fluentlenium.sample.pages; | |
import org.fluentlenium.core.FluentPage; | |
/** | |
* Created by s.radzyminski on 10/01/16. | |
*/ | |
public class FacebookLoggedOutPage extends FluentPage { | |
@Override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupId>org.fluentlenium</groupId> | |
<artifactId>fluentlenium-testng</artifactId> | |
<version>1.0.0-SNAPSHOT</version> | |
<scope>test</scope> | |
</dependency> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.fluentlenium.sample.pages; | |
import org.fluentlenium.core.FluentPage; | |
/** | |
* Created by s.radzyminski on 10/01/16. | |
*/ | |
public class GroupApprovePage extends FluentPage { | |
private static final String APPROVE_ALL_BUTTON = "[rel=async-post]"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
email=www.awesome-testing.blogspot.com | |
password=wwww.awesome-bookreviews.blogspot.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.fluentlenium.sample.support; | |
import java.io.FileInputStream; | |
import java.io.IOException; | |
import java.util.Properties; | |
/** | |
* Created by s.radzyminski on 12/22/2015. | |
*/ | |
public class LoadProperties { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private FacebookLoggedOutPage fbLogOutPage; | |
@BeforeMethod | |
public void authenticate() { | |
fbLogOutPage = createPage(FacebookLoggedOutPage.class); | |
fbLogOutPage.go(); | |
fbLogOutPage.login(EMAIL, PASSWORD); | |
fbLogOutPage.verifySuccessfulLogin(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.fluentlenium.sample.tests; | |
import org.fluentlenium.adapter.FluentTestNg; | |
import org.fluentlenium.sample.pages.FacebookLoggedOutPage; | |
import org.fluentlenium.sample.pages.GroupApprovePage; | |
import org.fluentlenium.sample.support.LoadProperties; | |
import org.testng.annotations.BeforeMethod; | |
import org.testng.annotations.Test; | |
public class FacebookTests extends FluentTestNg { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static final String PREFS = "prefs"; | |
@Override | |
public WebDriver getDefaultDriver() { | |
return new ChromeDriver(getChromeCapabilities()); | |
} | |
private DesiredCapabilities getChromeCapabilities() { | |
DesiredCapabilities capabilities = DesiredCapabilities.chrome(); | |
capabilities.setCapability(ChromeOptions.CAPABILITY, getChromeOptions()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static final String BROWSER_NOTIFICATIONS = "profile.managed_default_content_settings.notifications"; | |
private static final short DISABLED = 2; | |
/** | |
* Full list of available prefs - https://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/pref_names.cc?view=markup | |
* | |
* @return prefs | |
*/ | |
private Map<String, Object> getChromePrefs() { | |
Map<String, Object> chromePrefs = new HashMap<>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface ChromeSwitchesInt { | |
String START_FULLSCREEN = "start-fullscreen"; | |
String ALLOW_INSECURE_CONTENT = "allow-running-insecure-content"; | |
String INCOGNITO = "incognito"; | |
String IGNORE_CERTIFICATE_ERRORS = "--ignore-certificate-errors"; | |
} |
OlderNewer