diff --git a/lib/apress/selenium_eti/spec/company_site/eti/product_creation_spec.rb b/lib/apress/selenium_eti/spec/company_site/eti/product_creation_spec.rb index 97f9bfb..0b5301c 100644 --- a/lib/apress/selenium_eti/spec/company_site/eti/product_creation_spec.rb +++ b/lib/apress/selenium_eti/spec/company_site/eti/product_creation_spec.rb @@ -16,9 +16,8 @@ @name = Faker::Number.number(5) @cs_eti_page.add_product @cs_eti_page.set_name(@name) - @cs_eti_page.wait_until { @cs_eti_page.save_status == 'Все изменения сохранены' } + @cs_eti_page.wait_saving @cs_eti_page.refresh - @cs_eti_page.wait_until { @cs_eti_page.save_status == 'Все изменения сохранены' } @cs_eti_page.search_product(@name) end @@ -37,11 +36,11 @@ before(:all) do @name = Faker::Number.number(5) @cs_eti_page.add_product - @cs_eti_page.set_rubric(CONFIG['eti']['rubric']) @cs_eti_page.set_name(@name) + @cs_eti_page.wait_saving + @cs_eti_page.set_rubric(CONFIG['eti']['rubric']) @cs_eti_page.wait_until { @cs_eti_page.first_product_status_element.attribute('title') == 'Опубликованные' } @cs_eti_page.refresh - @cs_eti_page.wait_until { @cs_eti_page.save_status == 'Все изменения сохранены' } @cs_eti_page.search_product(@name) end @@ -85,7 +84,6 @@ @cs_eti_page.refresh @cs_eti_page.search_product(@product[:name]) - @cs_eti_page.wait_saving end it 'отобразится 2 идентичных товара' do diff --git a/lib/pages/company_site/eti_page.rb b/lib/pages/company_site/eti_page.rb index ed2208b..5d5514a 100644 --- a/lib/pages/company_site/eti_page.rb +++ b/lib/pages/company_site/eti_page.rb @@ -59,6 +59,7 @@ class EtiPage < Page link(:page_2, xpath: "//*[@data-page='2']") link(:page_1, xpath: "//*[@data-page='1']") span(:found_products_count, css: '.js-products-count') + spans(:product_names, css: '.js-eti-name') radio_button(:from_to, xpath: "(//*[@class = 'va-1 mr5 js-select-type-price'])[2]") radio_button(:discount, xpath: "(//*[@class = 'va-1 mr5 js-select-type-price'])[3]") @@ -319,6 +320,7 @@ def search_product(name) check_exact_search self.product_search = name search_button + wait_until { product_names_elements[0] != name } end def delete_product(name)