Search in sources :

Example 1 with TableBuilderComponentObject

use of com.wikia.webdriver.pageobjectsfactory.componentobject.addtable.TableBuilderComponentObject in project selenium-tests by Wikia.

the class ArticleFeaturesCRUDTestsUser method addingTable.

@Test(dataProviderClass = ArticleFeaturesCRUDDataProvider.class, dataProvider = "getTableProperties", groups = { "ArticleFeaturesCRUDUser_011" })
@Execute(asUser = User.USER)
public void addingTable(int border, int width, int height, int cellspacing, int cellpadding, Alignment alignment) {
    new ArticleContent().clear();
    VisualEditModePageObject visualEditMode = new VisualEditModePageObject().open();
    TableBuilderComponentObject addTable = visualEditMode.clickAddTableButton();
    addTable.verifyAddTableLightbox();
    addTable.typeAmountOfRows(3);
    addTable.typeAmountOfColumns(2);
    addTable.selectHeader(Headers.FIRSTCOLUMN);
    addTable.typeBorderSize(border);
    addTable.selectAlignment(alignment);
    addTable.typeWidth(width);
    addTable.typeHeight(height);
    addTable.typeCellSpacing(cellspacing);
    addTable.typeCellPadding(cellpadding);
    addTable.submitTable();
    ArticlePageObject article = visualEditMode.submitArticle();
    article.verifyTableBorder(border);
    article.verifyTableCellspacing(cellspacing);
    article.verifyTableCellpadding(cellpadding);
    article.verifyTableAlignment(alignment);
    article.verifyTableSize(width, height);
}
Also used : TableBuilderComponentObject(com.wikia.webdriver.pageobjectsfactory.componentobject.addtable.TableBuilderComponentObject) ArticleContent(com.wikia.webdriver.common.core.api.ArticleContent) ArticlePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject) VisualEditModePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.article.editmode.VisualEditModePageObject) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test)

Example 2 with TableBuilderComponentObject

use of com.wikia.webdriver.pageobjectsfactory.componentobject.addtable.TableBuilderComponentObject in project selenium-tests by Wikia.

the class ArticleFeaturesCRUDTestsUser method modifyTable.

@Test(dataProviderClass = ArticleFeaturesCRUDDataProvider.class, dataProvider = "getTableProperties", groups = { "ArticleFeaturesCRUDUser_012" }, enabled = false)
@Execute(asUser = User.USER)
public void modifyTable(int border, int width, int height, int cellspacing, int cellpadding, Alignment alignment) {
    new ArticleContent().push(String.format("{| border=\"%d\" cellpadding=\"%d\" cellspacing=\"%d\" " + "class=\"article-table article-table-selected\" " + "style=\"float: %s; height: %dpx; width: %dpx;\"\n" + "! scope=\"row\"|\n|\n|-\n! scope=\"row\"|\n|\n" + "|-\n! scope=\"row\"|\n|\n" + "|}", border, cellpadding, cellspacing, alignment.getAlignment(), height, width));
    VisualEditModePageObject visualEditMode = new VisualEditModePageObject().open();
    visualEditMode.clickPropertiesTableButton();
    TableBuilderComponentObject addTable = new TableBuilderComponentObject(driver);
    addTable.typeBorderSize(border + additionalPropertyValue);
    addTable.typeCellSpacing(cellspacing + additionalPropertyValue);
    addTable.typeCellPadding(cellpadding + additionalPropertyValue);
    addTable.submitTable();
    ArticlePageObject article = visualEditMode.submitArticle();
    article.verifyTableBorder(border + additionalPropertyValue);
    article.verifyTableCellspacing(cellspacing + additionalPropertyValue);
    article.verifyTableCellpadding(cellpadding + additionalPropertyValue);
}
Also used : TableBuilderComponentObject(com.wikia.webdriver.pageobjectsfactory.componentobject.addtable.TableBuilderComponentObject) ArticleContent(com.wikia.webdriver.common.core.api.ArticleContent) ArticlePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject) VisualEditModePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.article.editmode.VisualEditModePageObject) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test)

Aggregations

Execute (com.wikia.webdriver.common.core.annotations.Execute)2 ArticleContent (com.wikia.webdriver.common.core.api.ArticleContent)2 TableBuilderComponentObject (com.wikia.webdriver.pageobjectsfactory.componentobject.addtable.TableBuilderComponentObject)2 ArticlePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject)2 VisualEditModePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.article.editmode.VisualEditModePageObject)2 Test (org.testng.annotations.Test)2