From 8b7a60e1ccb995b6044c8098cc34d75821117904 Mon Sep 17 00:00:00 2001 From: ovsyanik-ka Date: Fri, 30 Apr 2021 18:15:24 +0500 Subject: [PATCH] fix(selenium): fix after release april --- .../company_site/eti/product_creation_spec.rb | 3 +-- .../spec/company_site/minieti_spec.rb | 24 +++++++++---------- 2 files changed, 13 insertions(+), 14 deletions(-) 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 6e88ad4..93b0004 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 @@ -63,7 +63,7 @@ context 'когда копируем товар' do before(:all) do @product = { - name: Faker::Number.number(digits: 5), + name: Faker::Number.leading_zero_number(digits: 5), rubric: CONFIG['eti']['rubric'], exists: CONFIG['eti']['exists']['in stock'], short_description: CONFIG['product_creation']['short_description']['valid'], @@ -93,7 +93,6 @@ expect(@cs_eti_page.product_rows_elements.length).to eq 2 expect(@cs_eti_page.product_rows_elements[1].text).to eq @first_product end - end end end diff --git a/lib/apress/selenium_eti/spec/company_site/minieti_spec.rb b/lib/apress/selenium_eti/spec/company_site/minieti_spec.rb index 7168457..bf482c0 100644 --- a/lib/apress/selenium_eti/spec/company_site/minieti_spec.rb +++ b/lib/apress/selenium_eti/spec/company_site/minieti_spec.rb @@ -16,7 +16,7 @@ context 'когда заполняем имя' do before(:all) do @cs_eti_page.add_product - @name = Faker::Number.number(5) + @name = Faker::Number.leading_zero_number(5) @cs_eti_page.set_name(@name) end @@ -46,15 +46,15 @@ context 'когда заполняем цену' do before(:all) do @cs_eti_page.add_product - @cs_eti_page.set_name(Faker::Number.number(digits: 5)) + @cs_eti_page.set_name(Faker::Number.leading_zero_number(digits: 5)) @thermometer_value = @cs_eti_page.thermometer_value @price = Faker::Number.number(digits: 3) - @cs_eti_page.set_price(@price) + @cs_eti_page.set_price(@price.to_s) end it 'введенная цена отображается' do - expect(@cs_eti_page.price_value).to include @price + expect(@cs_eti_page.price_value).to include @price.to_s end it 'увеличивается градус на термометре' do @@ -65,10 +65,10 @@ context 'когда заполняем цену от и до' do before(:all) do @cs_eti_page.add_product - @cs_eti_page.set_name(Faker::Number.number(digits: 5)) + @cs_eti_page.set_name(Faker::Number.leading_zero_number(digits: 5)) @thermometer_value = @cs_eti_page.thermometer_value - @price_from_to = {from: Faker::Number.number(digits: 2), to: Faker::Number.number(digits: 3)} + @price_from_to = {from: Faker::Number.number(digits: 2).to_s, to: Faker::Number.number(digits: 3).to_s} @cs_eti_page.set_price_from_to(@price_from_to) end @@ -81,10 +81,10 @@ context 'когда заполняем цену со скидкой' do before(:all) do @cs_eti_page.add_product - @cs_eti_page.set_name(Faker::Number.number(digits: 5)) + @cs_eti_page.set_name(Faker::Number.leading_zero_number(digits: 5)) @thermometer_value = @cs_eti_page.thermometer_value - @discount_price = {previous: Faker::Number.number(digits: 3), discount: Faker::Number.number(digits: 2)} + @discount_price = {previous: Faker::Number.number(digits: 3).to_s, discount: Faker::Number.number(digits: 2).to_s} @cs_eti_page.set_discount_price(@discount_price) end @@ -99,7 +99,7 @@ context 'когда заполняем наличие' do before do @cs_eti_page.add_product - @cs_eti_page.set_name(Faker::Number.number(digits: 5)) + @cs_eti_page.set_name(Faker::Number.leading_zero_number(digits: 5)) @cs_eti_page.set_exists(CONFIG['eti']['exists']['in stock']) end @@ -111,7 +111,7 @@ context 'когда заполняем рубрику' do before(:all) do @cs_eti_page.add_product - @cs_eti_page.set_name(Faker::Number.number(digits: 5)) + @cs_eti_page.set_name(Faker::Number.leading_zero_number(digits: 5)) @rubric = @cs_eti_page.rubric_cell @cs_eti_page.set_rubric(CONFIG['eti']['rubric']) end @@ -165,7 +165,7 @@ describe 'Удаление товара' do before do @cs_eti_page.add_product - @name = Faker::Number.number(digits: 5) + @name = Faker::Number.leading_zero_number(digits: 5) @cs_eti_page.set_name(@name) @cs_mini_eti_page.delete_first_product end @@ -180,7 +180,7 @@ @cs_eti_page.add_product @name = Faker::Games::Pokemon.name @cs_eti_page.set_name(@name) - @cs_eti_page.set_price(@price = Faker::Number.number(digits: 5)) + @cs_eti_page.set_price(@price = Faker::Number.number(digits: 5).to_s) @cs_eti_page.wait_saving @cs_mini_eti_page.copy_product