예제 #1
0
def test_blackShoes_filter_task2(py, report_generator, width, height,
                                 displayType, location, testName):
    filterPage = HomePage(py, width, height,
                          py.config.custom['environment']['homeUrl'])

    if displayType != DESKTOP:
        filterPage.openLeftSideFilter()

    productsFiltered = filterPage.getBlackColorProducts()

    # @TODO: work with developers in order to have color of results in the DOM
    # Here, I just check that the number of results is 2 and that
    # we only retrieve product_1 and product_8 and nothing else
    # which might not be true in the real world where product list is dynamic

    NbElements = productsFiltered.children().length()
    product1 = filterPage.getProduct_1()
    product2 = filterPage.getProduct_8()

    assert (NbElements == 2 and product1.get_attribute('href')
            == py.config.custom['environment']['productDetailUrl'] + '?id=1'
            and product2.get_attribute('href')
            == py.config.custom['environment']['productDetailUrl'] + '?id=8')