Skip to content

Commit

Permalink
webdriver: Add Tag Name as a valid location strategy. (mozilla#118)
Browse files Browse the repository at this point in the history
* Add Tag Name as a valid location strategy.

While creating WDSpec for Find Element and similar commands it showed
that we do not support Tag Name as a valid selector. Tests can be found
at https://reviewboard.mozilla.org/r/172110/

Source-Repo: https://github.com/mozilla/webdriver-rust
Source-Revision: 5cd49eb129f4ae1ae7e047f274cfa31092353d65

committer: jgraham <[email protected]>

--HG--
extra : subtree_source : http%3A//tristan.corp.lon2.mozilla.com%3A8000
extra : subtree_revision : a2245a52d6ad17184dc8b105cd2082899707bdda
  • Loading branch information
AutomatedTester committed Aug 24, 2017
1 parent 4c3170d commit 5ff5b69
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions testing/webdriver/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ pub enum LocatorStrategy {
CSSSelector,
LinkText,
PartialLinkText,
TagName,
XPath,
}

Expand All @@ -200,6 +201,7 @@ impl LocatorStrategy {
"css selector" => Ok(LocatorStrategy::CSSSelector),
"link text" => Ok(LocatorStrategy::LinkText),
"partial link text" => Ok(LocatorStrategy::PartialLinkText),
"tag name" => Ok(LocatorStrategy::TagName),
"xpath" => Ok(LocatorStrategy::XPath),
x => Err(WebDriverError::new(ErrorStatus::InvalidArgument,
format!("Unknown locator strategy {}", x)))
Expand All @@ -213,6 +215,7 @@ impl ToJson for LocatorStrategy {
LocatorStrategy::CSSSelector => "css selector",
LocatorStrategy::LinkText => "link text",
LocatorStrategy::PartialLinkText => "partial link text",
LocatorStrategy::TagName => "tag name",
LocatorStrategy::XPath => "xpath"
}.to_string())
}
Expand Down

0 comments on commit 5ff5b69

Please sign in to comment.