diff options
author | Eric Eastwood <contact@ericeastwood.com> | 2018-03-27 20:39:18 +0300 |
---|---|---|
committer | Eric Eastwood <contact@ericeastwood.com> | 2018-03-27 20:39:18 +0300 |
commit | de0c4730bb83b94195678e5ad4865ea648e6585f (patch) | |
tree | 3ea0fd48c5736b0f5b328f117c3db0508a371d22 /qa/qa/runtime/address.rb | |
parent | dc5b5130d573a48fc34fa62862a1ad6da776b0d0 (diff) | |
parent | a1cde68d208437a470267e28ccff66fe8be88c2e (diff) |
Merge branch 'master' into add-canary-favicon
Diffstat (limited to 'qa/qa/runtime/address.rb')
-rw-r--r-- | qa/qa/runtime/address.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/qa/qa/runtime/address.rb b/qa/qa/runtime/address.rb new file mode 100644 index 00000000000..ffad3974b02 --- /dev/null +++ b/qa/qa/runtime/address.rb @@ -0,0 +1,20 @@ +module QA + module Runtime + class Address + attr_reader :address + + def initialize(instance, page = nil) + @instance = instance + @address = host + (page.is_a?(String) ? page : page&.path) + end + + def host + if @instance.is_a?(Symbol) + Runtime::Scenario.send("#{@instance}_address") + else + @instance.to_s + end + end + end + end +end |