Hi Titus/Justin
Extremely strange things happening in remote box when I directly ran the
script from there.
Im using this in local and remote
def rewards_popup_expiration
return cta_expiry_element.when_present.text.gsub(/[^$,.A-Za-z0-9]/," ")
end
On local this passes in the sense it gets the text and asserts it to true
However in remote its complaing as
And the customer sees the overlay popup message "$10 reward activated"
features/step_definitions/Loyalty_steps.rb:7
timed out after 30 seconds, Element not present in 30 seconds
(Watir::Wait::TimeoutError)
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/watir-6.12.0/lib/watir/wait.rb:49:in
`until'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/watir-6.12.0/lib/watir/wait.rb:126:in
`wait_until'
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/page-object-2.2.4/lib/page-object/elements/element.rb:133:in
`when_present'
D:/Jenkins/workspace/cog-checkout-loyalty-nightly-cuke-tests/cuke-tests/features/support/pages/Frontend/Cotton_On/Loyalty_Page.rb:14:in
`rewards_popup_description'
D:/Jenkins/workspace/cog-checkout-loyalty-nightly-cuke-tests/cuke-tests/features/step_definitions/Loyalty_steps.rb:9:in
`block (2 levels) in '
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/page-object-2.2.4/lib/page-object/page_factory.rb:75:in
`on_page'
D:/Jenkins/workspace/cog-checkout-loyalty-nightly-cuke-tests/cuke-tests/features/step_definitions/Loyalty_steps.rb:8:in
`block in '
C:/Ruby24-x64/bin/cucumber:23:in `load'
C:/Ruby24-x64/bin/cucumber:23:in `'
features/Loyalty-AU.feature:122:in `And the customer sees the overlay popup
message "$10 reward activated"'
I did a quick verification of watir, and pageobect versions. Both are
same... Any clue???
On local
Gems included by the bundle:
* actionpack (5.2.0)
* actionview (5.2.0)
* activemodel (5.2.0)
* activerecord (5.2.0)
* activerecord-oracle_enhanced-adapter (5.2.2)
* activesupport (5.2.0)
* addressable (2.5.2)
* arel (9.0.0)
* backports (3.11.3)
* builder (3.2.3)
* bundler (1.16.2)
* childprocess (0.9.0)
* concurrent-ruby (1.0.5)
* connection_pool (2.2.2)
* crass (1.0.4)
* cucumber (3.1.2)
* cucumber-core (3.2.0)
* cucumber-expressions (6.0.1)
* cucumber-tag_expressions (1.1.1)
* cucumber-wire (0.0.1)
* data_magic (1.2)
* diff-lcs (1.3)
* domain_name (0.5.20180417)
* erubi (1.7.1)
* faker (1.9.1)
* ffi (1.9.25)
* fig_newton (1.0)
* gherkin (5.1.0)
* http-cookie (1.0.3)
* i18n (1.0.1)
* json (2.1.0)
* log4r (1.1.10)
* loofah (2.2.2)
* mime-types (3.1)
* mime-types-data (3.2016.0521)
* mini_portile2 (2.3.0)
* minitest (5.11.3)
* multi_json (1.13.1)
* multi_test (0.1.2)
* net-http-persistent (3.0.0)
* netrc (0.11.0)
* nokogiri (1.8.4)
* page-object (2.2.4)
* page_navigation (0.10)
* parallel (1.12.1)
* parallel_tests (2.22.0)
* pretty_face (0.10.3)
* public_suffix (3.0.2)
* rack (2.0.5)
* rack-test (1.1.0)
* rails-dom-testing (2.0.3)
* rails-html-sanitizer (1.0.4)
* rake (12.3.1)
* require_all (2.0.0)
* rest-client (2.0.2)
* rspec (3.8.0)
* rspec-core (3.8.0)
* rspec-expectations (3.8.1)
* rspec-mocks (3.8.0)
* rspec-support (3.8.0)
* ruby-oci8 (2.2.5.1)
* ruby-ole (1.2.12.1)
* ruby-plsql (0.6.0)
* ruby-rc4 (0.1.5)
* rubyzip (1.2.1)
* sauce_whisk (0.1.0)
* saucelabs (0.5)
* selenium-webdriver (3.14.0)
* syntax (1.2.2)
* thread_safe (0.3.6)
* tzinfo (1.2.5)
* unf (0.1.4)
* unf_ext (0.0.7.5)
* watir (6.12.0)
* watir-scroll (0.2.0)
* watir-webdriver (0.9.9)
* yard (0.9.15)
* yard-cucumber (4.0.0)
* yml_reader (0.7)
On remote
Gems included by the bundle:
* actionpack (5.2.0)
* actionview (5.2.0)
* activemodel (5.2.0)
* activerecord (5.2.0)
* activerecord-oracle_enhanced-adapter (5.2.2)
* activesupport (5.2.0)
* addressable (2.5.2)
* arel (9.0.0)
* backports (3.11.3)
* builder (3.2.3)
* bundler (1.16.3)
* childprocess (0.9.0)
* concurrent-ruby (1.0.5)
* connection_pool (2.2.2)
* crass (1.0.4)
* cucumber (3.1.2)
* cucumber-core (3.2.0)
* cucumber-expressions (6.0.1)
* cucumber-tag_expressions (1.1.1)
* cucumber-wire (0.0.1)
* data_magic (1.2)
* diff-lcs (1.3)
* domain_name (0.5.20180417)
* erubi (1.7.1)
* faker (1.9.1)
* ffi (1.9.25)
* fig_newton (1.0)
* gherkin (5.1.0)
* http-cookie (1.0.3)
* i18n (1.0.1)
* json (2.1.0)
* log4r (1.1.10)
* loofah (2.2.2)
* mime-types (3.1)
* mime-types-data (3.2016.0521)
* mini_portile2 (2.3.0)
* minitest (5.11.3)
* multi_json (1.13.1)
* multi_test (0.1.2)
* net-http-persistent (3.0.0)
* netrc (0.11.0)
* nokogiri (1.8.4)
* page-object (2.2.4)
* page_navigation (0.10)
* parallel (1.12.1)
* parallel_tests (2.22.0)
* pretty_face (0.10.3)
* public_suffix (3.0.2)
* rack (2.0.5)
* rack-test (1.1.0)
* rails-dom-testing (2.0.3)
* rails-html-sanitizer (1.0.4)
* rake (12.3.1)
* require_all (2.0.0)
* rest-client (2.0.2)
* rspec (3.7.0)
* rspec-core (3.7.1)
* rspec-expectations (3.7.0)
* rspec-mocks (3.7.0)
* rspec-support (3.7.1)
* ruby-oci8 (2.2.5.1)
* ruby-ole (1.2.12.1)
* ruby-plsql (0.6.0)
* ruby-rc4 (0.1.5)
* rubyzip (1.2.1)
* sauce_whisk (0.1.0)
* saucelabs (0.5)
* selenium-webdriver (3.13.1)
* syntax (1.2.2)
* thread_safe (0.3.6)
* tzinfo (1.2.5)
* unf (0.1.4)
* unf_ext (0.0.7.5)
* watir (6.12.0)
* watir-scroll (0.2.0)
* watir-webdriver (0.9.9)
* yard (0.9.15)
* yard-cucumber (4.0.0)
* yml_reader (0.7)
On Friday, 3 August 2018 15:12:45 UTC+10, NaviHan wrote:
>
> I have a functionality where I click an a link from an email a voucher
> gets added to the shopping cart and a pop up appears with a message. Im
> trying to assert the text in the popup
> I have defined the element as
>
> div(:cta_description, :css => '.homepage-clicktoactiavte-description')
>
> Tried to use a mix of Watir and Pageobejct to read the text. The below
> code works 5 out of 10 times.
>
> @rewards_popup_txt = Watir::Wait.until{cta_description_element}.text
> @rewards_popup_txt = @rewards_popup_txt.gsub(/[^$,.A-Za-z0-9]/," ")
> return @rewards_popup_txt
>
>
> Tried using, which doesnt even set the @reward_popup_txt and shows error
>
>
> if (Watir::Wait.while {cta_description_element.visible?})
> @rewards_popup_txt = cta_description_element.text
> end
> @rewards_popup_txt = @rewards_popup_txt.gsub(/[^$,.A-Za-z0-9]/," ")
> return @rewards_popup_txt
>
> Error
> NoMethodError: undefined method `gsub' for nil:NilClass
> ./features/support/pages/Frontend/Cotton_On/Loyalty_Page.rb:22:in `
> rewards_popup_description'
>
> Any stable way to do the job?
>
--
--
Before posting, please read
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
In short: search before you ask, be nice.
[email protected]
http://groups.google.com/group/watir-general
[email protected]
---
You received this message because you are subscribed to the Google Groups
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.