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 47a598c..a2b77cc 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 @@ -14,7 +14,7 @@ describe 'Создание товара' do context 'когда товар без рубрики' do before(:all) do - @name = Faker::Number.leading_zero_number(digits: 5) + @name = Faker::Number.leading_zero_number(digits: 5).to_s @cs_eti_page.add_product @cs_eti_page.set_name(@name) @cs_eti_page.wait_saving @@ -35,7 +35,7 @@ context 'когда товар с рубрикой' do before(:all) do - @name = Faker::Number.number(digits: 5) + @name = Faker::Number.number(digits: 5).to_s @cs_eti_page.add_product @cs_eti_page.set_name(@name) @cs_eti_page.wait_saving diff --git a/lib/apress/selenium_eti/spec/company_site/eti/product_groups_spec.rb b/lib/apress/selenium_eti/spec/company_site/eti/product_groups_spec.rb index 8f2c802..e85d2a1 100644 --- a/lib/apress/selenium_eti/spec/company_site/eti/product_groups_spec.rb +++ b/lib/apress/selenium_eti/spec/company_site/eti/product_groups_spec.rb @@ -13,7 +13,7 @@ describe 'Добавление групп' do context 'когда привязываем группу к товару' do before(:all) do - @product = {name: Faker::Number.number(digits: 5)} + @product = {name: Faker::Number.number(digits: 5).to_s} @cs_eti_page.create_and_set_product_fields(@product) @cs_eti_page.set_group(CONFIG['product_creation']['group']) @cs_eti_page.wait_saving diff --git a/lib/apress/selenium_eti/spec/company_site/eti/product_price_spec.rb b/lib/apress/selenium_eti/spec/company_site/eti/product_price_spec.rb index ca0bc06..cdda600 100644 --- a/lib/apress/selenium_eti/spec/company_site/eti/product_price_spec.rb +++ b/lib/apress/selenium_eti/spec/company_site/eti/product_price_spec.rb @@ -13,7 +13,7 @@ describe 'Установка цен', feature: 'company_site/eti/product_price_spec: Установка цен' do before do - @name = Faker::Number.number(digits: 5) + @name = Faker::Number.number(digits: 5).to_s @cs_eti_page.add_product @cs_eti_page.set_name(@name) end diff --git a/lib/pages/company_site/eti_page.rb b/lib/pages/company_site/eti_page.rb index ca3e4e2..a036498 100644 --- a/lib/pages/company_site/eti_page.rb +++ b/lib/pages/company_site/eti_page.rb @@ -154,24 +154,14 @@ def set_discount_price(options = {}) end def set_price(text) - browser - .action - .move_to(price_cell_element.element) - .click - .send_keys(price_text_area_element.element, text) - .perform - + price_cell_element.click + self.price_text_area = text try_to(:save_price) wait_saving end def set_wholesale_price(options = {}) - browser - .action - .move_to(wholesale_price_cell_element.element) - .click - .perform - + wholesale_price_cell_element.click self.wholesale_price = options.fetch(:wholesale_price, '') self.wholesale_number = options.fetch(:wholesale_number, '') @@ -180,11 +170,7 @@ def set_wholesale_price(options = {}) end def set_rubric(text) - browser - .action - .move_to(rubric_cell_element.element) - .click - .perform + rubric_cell_element.click self.rubric_search = text rubric_search_submit