Search in sources :

Example 1 with PreferencesPageObject

use of com.wikia.webdriver.pageobjectsfactory.pageobject.special.preferences.PreferencesPageObject in project selenium-tests by Wikia.

the class EditingPreferencesTests method EditPreferences_001_selectVE.

@Test(groups = { "EditPreferences_001" })
@Execute(asUser = User.USER_5, onWikia = URLsContent.VE_ENABLED_WIKI)
@RelatedIssue(issueID = "MAIN-9722", comment = "test failing randomly")
public void EditPreferences_001_selectVE() {
    EditPreferencesPage editPrefPage = new EditPreferencesPage(driver).openEditingSection();
    editPrefPage.selectPreferredEditor(VE);
    PreferencesPageObject prefPage = editPrefPage.clickSaveButton();
    List<Notification> confirmNotifications = prefPage.getNotifications(NotificationType.CONFIRM);
    Assertion.assertEquals(confirmNotifications.size(), 1, PreferencesPageObject.AssertionMessages.INVALID_NUMBER_OF_CONFIRMING_NOTIFICATIONS);
    Assertion.assertTrue(confirmNotifications.stream().findFirst().get().isVisible(), PreferencesPageObject.AssertionMessages.BANNER_NOTIFICATION_NOT_VISIBLE);
    String articleName = PageContent.ARTICLE_NAME_PREFIX + DateTime.now().getMillis();
    ArticlePageObject aritclePage = new ArticlePageObject().open(articleName);
    VisualEditorPageObject ve = aritclePage.openVEModeWithMainEditButton();
    ve.verifyVEToolBarPresent();
    ve.verifyEditorSurfacePresent();
}
Also used : ArticlePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject) EditPreferencesPage(com.wikia.webdriver.pageobjectsfactory.pageobject.special.preferences.EditPreferencesPage) PreferencesPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.special.preferences.PreferencesPageObject) VisualEditorPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.visualeditor.VisualEditorPageObject) Notification(com.wikia.webdriver.elements.oasis.components.notifications.Notification) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test) RelatedIssue(com.wikia.webdriver.common.core.annotations.RelatedIssue)

Example 2 with PreferencesPageObject

use of com.wikia.webdriver.pageobjectsfactory.pageobject.special.preferences.PreferencesPageObject in project selenium-tests by Wikia.

the class UnderTheHoodPreferencesTests method UnderTheHoodPreference_001_Use_advanced_recent_changes.

@Test(groups = { "UnderTheHoodPreferencesTest", "UnderTheHoodPreference_001" })
@Execute(asUser = User.USER_5, onWikia = URLsContent.VE_ENABLED_WIKI)
public void UnderTheHoodPreference_001_Use_advanced_recent_changes() {
    PreferencesPageObject preferences = new WikiBasePageObject().openSpecialPreferencesPage(wikiURL);
    preferences.setAdvancedRecentChangesCheckboxValueToDefaultUnchecked().setAdvancedRecentChangesCheckbox().clickSaveButton();
    Assertion.assertTrue(preferences.getAdvancedRecentChangesCheckboxValue());
}
Also used : PreferencesPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.special.preferences.PreferencesPageObject) WikiBasePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.WikiBasePageObject) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test)

Example 3 with PreferencesPageObject

use of com.wikia.webdriver.pageobjectsfactory.pageobject.special.preferences.PreferencesPageObject in project selenium-tests by Wikia.

the class FacebookButtonTests method facebookButtonIsVisibleOnUserPreferencesPage.

@Test(groups = "FacebookButton_facebookButtonIsVisibleOnUserPreferencesPage")
@Execute(asUser = User.USER)
public void facebookButtonIsVisibleOnUserPreferencesPage() {
    WikiBasePageObject base = new WikiBasePageObject();
    PreferencesPageObject prefsPage = base.openSpecialPreferencesPage(wikiURL);
    prefsPage.selectTab(tabNames.FACEBOOK);
    prefsPage.verifyFBButtonVisible();
}
Also used : PreferencesPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.special.preferences.PreferencesPageObject) WikiBasePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.WikiBasePageObject) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test)

Example 4 with PreferencesPageObject

use of com.wikia.webdriver.pageobjectsfactory.pageobject.special.preferences.PreferencesPageObject in project selenium-tests by Wikia.

the class UserAndRights method blockedUserShouldBeAbleToChangeEmail.

@Test(groups = { "usersAndRights003" }, dependsOnMethods = { "staffCanBlockUser" })
@Execute(asUser = User.BLOCKED_USER)
public void blockedUserShouldBeAbleToChangeEmail() {
    String username = Configuration.getCredentials().emailQaart2;
    String password = Configuration.getCredentials().emailPasswordQaart2;
    EditPreferencesPage editPrefPage = new EditPreferencesPage(driver).openEmailSection();
    editPrefPage.verifyUserLoggedIn(User.BLOCKED_USER);
    editPrefPage.openEmailSection();
    EmailUtils.deleteAllEmails(username, password);
    String newEmailAddress = EmailUtils.getEmail(editPrefPage.getEmailAdress());
    editPrefPage.changeEmail(newEmailAddress);
    PreferencesPageObject prefPage = editPrefPage.clickSaveButton();
    List<Notification> confirmNotifications = prefPage.getNotifications(NotificationType.CONFIRM);
    Assertion.assertEquals(confirmNotifications.size(), 1, PreferencesPageObject.AssertionMessages.INVALID_NUMBER_OF_CONFIRMING_NOTIFICATIONS);
    Assertion.assertTrue(confirmNotifications.stream().findFirst().get().isVisible(), PreferencesPageObject.AssertionMessages.BANNER_NOTIFICATION_NOT_VISIBLE);
    prefPage.enterEmailChangeLink(username, password);
    editPrefPage.openEmailSection();
    Assertion.assertEquals(editPrefPage.getEmailAdress(), newEmailAddress);
}
Also used : EditPreferencesPage(com.wikia.webdriver.pageobjectsfactory.pageobject.special.preferences.EditPreferencesPage) PreferencesPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.special.preferences.PreferencesPageObject) Notification(com.wikia.webdriver.elements.oasis.components.notifications.Notification) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test)

Example 5 with PreferencesPageObject

use of com.wikia.webdriver.pageobjectsfactory.pageobject.special.preferences.PreferencesPageObject in project selenium-tests by Wikia.

the class EditingPreferencesTests method changeEmailAddress.

@Test(groups = { "EditPreferences_004" })
@Execute(asUser = User.USER_5)
public void changeEmailAddress() {
    EditPreferencesPage editPrefPage = new EditPreferencesPage(driver).openEmailSection();
    String newEmailAddress = EmailUtils.getEmail(editPrefPage.getEmailAdress());
    EmailUtils.deleteAllEmails(USERNAME, PASSWORD);
    Assertion.assertNotEquals(newEmailAddress, editPrefPage.getEmailAdress(), "New email and old email SHOULD NOT be the same");
    editPrefPage.changeEmail(newEmailAddress);
    PreferencesPageObject prefPage = editPrefPage.clickSaveButton();
    List<Notification> confirmNotifications = prefPage.getNotifications(NotificationType.CONFIRM);
    Assertion.assertEquals(confirmNotifications.size(), 1, PreferencesPageObject.AssertionMessages.INVALID_NUMBER_OF_CONFIRMING_NOTIFICATIONS);
    Assertion.assertTrue(confirmNotifications.stream().findFirst().get().isVisible(), PreferencesPageObject.AssertionMessages.BANNER_NOTIFICATION_NOT_VISIBLE);
    editPrefPage.enterEmailChangeLink(USERNAME, PASSWORD);
    editPrefPage.openEmailSection();
    Assertion.assertEquals(editPrefPage.getEmailAdress(), newEmailAddress, "Email address doesn't equal to new email address");
}
Also used : EditPreferencesPage(com.wikia.webdriver.pageobjectsfactory.pageobject.special.preferences.EditPreferencesPage) PreferencesPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.special.preferences.PreferencesPageObject) Notification(com.wikia.webdriver.elements.oasis.components.notifications.Notification) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test)

Aggregations

Execute (com.wikia.webdriver.common.core.annotations.Execute)7 PreferencesPageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.special.preferences.PreferencesPageObject)7 Test (org.testng.annotations.Test)7 Notification (com.wikia.webdriver.elements.oasis.components.notifications.Notification)5 EditPreferencesPage (com.wikia.webdriver.pageobjectsfactory.pageobject.special.preferences.EditPreferencesPage)5 ArticlePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject)3 RelatedIssue (com.wikia.webdriver.common.core.annotations.RelatedIssue)2 WikiBasePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.WikiBasePageObject)2 SourceEditModePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.article.editmode.SourceEditModePageObject)1 VisualEditModePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.article.editmode.VisualEditModePageObject)1 VisualEditorPageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.visualeditor.VisualEditorPageObject)1