@@ -25,18 +25,18 @@ def test_amazon_book_search_001():
25
25
dynamic_variable = Var ("amazon_book_search_result_dynamic.yml" , "dynamic" )
26
26
27
27
with allure .step ("Initialize the driver and navigate to the url" ):
28
- driver = Driver () # Initialize the driver. Driver configurations will be taken from the global_data.yml file
28
+ driver = Driver () # Initialize the driver. Driver configurations will be taken from the global_data.yml file
29
29
driver .get (static_variable .static_value_for ("url" ))
30
30
assert (AmazonHomePage .is_home_page_displayed () is True ), "Amazon home page is not displayed"
31
31
32
32
with allure .step ("Select the categories as books in the search dropdown" ):
33
33
AmazonHomePage .select_category_drop_down (static_variable .static_value_for ("category" ))
34
- assert (AmazonHomePage .get_selected_category () == static_variable .static_value_for ("category" )), \
35
- "Category is not selected properly"
36
34
37
35
with allure .step ("Search for the text which is needed in this" ):
38
36
search_text = static_variable .static_value_for ("search_text" )
39
37
AmazonHomePage .search_in_the_search_box (search_text )
38
+ assert (AmazonHomePage .get_selected_category () == static_variable .static_value_for ("category" )), \
39
+ "Category is not selected properly"
40
40
assert (AmazonSearchResultPage .is_search_result_page_displayed () is True ), "Search result page is not displayed"
41
41
assert (AmazonSearchResultPage .is_filter_set_in_head_liner (search_text ) is True ), "Searched text is not " \
42
42
"displayed in the result page"
@@ -75,6 +75,7 @@ def test_amazon_book_search_001():
75
75
AmazonSearchResultPage .select_a_product_from_search_result (static_variable .static_value_for ("select_product" ))
76
76
assert (driver .window_handles_count () == 2 ), "New tab is not opened after clicking a product"
77
77
driver .switch_to_new_tab ()
78
+ driver .wait_till_page_loads (30 )
78
79
assert (AmazonProductPage .is_product_page_displayed () is True ), "Product page is not displayed after selecting"
79
80
80
81
with allure .step ("Set the delivery pincode in the product page" ):
0 commit comments