Search in sources :

Example 6 with PreferencesPageObject

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

the class EditingPreferencesTests method EditPreferences_003_selectSource.

@Test(groups = { "EditPreferences_003" })
@Execute(asUser = User.USER_5, onWikia = URLsContent.VE_ENABLED_WIKI)
public void EditPreferences_003_selectSource() {
    EditPreferencesPage editPrefPage = new EditPreferencesPage(driver).openEditingSection();
    editPrefPage.selectPreferredEditor(SOURCE);
    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);
    SourceEditModePageObject src = aritclePage.openSrcModeWithMainEditButton();
    src.verifySourceOnlyMode();
}
Also used : ArticlePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject) EditPreferencesPage(com.wikia.webdriver.pageobjectsfactory.pageobject.special.preferences.EditPreferencesPage) SourceEditModePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.article.editmode.SourceEditModePageObject) 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 7 with PreferencesPageObject

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

the class EditingPreferencesTests method EditPreferences_002_selectCK.

@Test(groups = { "EditPreferences_002" })
@Execute(asUser = User.USER_5, onWikia = URLsContent.VE_ENABLED_WIKI)
@RelatedIssue(issueID = "MAIN-9722", comment = "test failing randomly")
public void EditPreferences_002_selectCK() {
    EditPreferencesPage editPrefPage = new EditPreferencesPage(driver).openEditingSection();
    editPrefPage.selectPreferredEditor(CK);
    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);
    VisualEditModePageObject ck = aritclePage.navigateToArticleEditPage();
    Assertion.assertTrue(ck.isContentLoaded(), "Content is not loaded");
    ck.clickPublishButton();
}
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) VisualEditModePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.article.editmode.VisualEditModePageObject) 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)

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