-
-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[plugin-web-app-to-rest-api] Add XPath support for resource validatio… #4683
Conversation
Qodana Community for JVMIt seems all right 👌 No new problems were found according to the checks applied 💡 Qodana analysis was run in the pull request mode: only the changed files were checked Contact Qodana teamContact us at qodana-support@jetbrains.com
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4683 +/- ##
============================================
- Coverage 97.40% 97.39% -0.02%
+ Complexity 6801 6797 -4
============================================
Files 917 916 -1
Lines 18876 18872 -4
Branches 1254 1254
============================================
- Hits 18387 18381 -6
- Misses 383 384 +1
- Partials 106 107 +1 ☔ View full report in Codecov by Sentry. |
dbff6bf
to
d572ad6
Compare
d572ad6
to
6a57cf3
Compare
return getElements(baseUri, html, d -> d.select(locator)); | ||
} | ||
return getElements(baseUri, html, d -> d.selectXpath(locator)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function
should be moved to HtmlLocatorType
@@ -278,16 +280,17 @@ private static boolean isNotAbsolute(URI uri) | |||
* c. If GET status code acceptable than check considered as passed otherwise failed; | |||
* <b>Example:</b> | |||
* <pre> | |||
* Then all resources by selector a are valid on: | |||
* Then all resources found by css selector `a` are valid on: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Then all resources found by css selector `a` are valid on: | |
* Then all resources found by CSS selector `a` are valid on: |
@@ -0,0 +1,8 @@ | |||
Composite: Then all resources by selector `$cssSelector` from $html are valid | |||
!-- DEPRECATED: 0.7.0, Then all resources found by $locatorType `$locator` in $html are valid | |||
Then all resources found by css selector `<cssSelector>` in <html> are valid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then all resources found by css selector `<cssSelector>` in <html> are valid | |
Then all resources found by CSS selector `<cssSelector>` in <html> are valid |
|
||
Composite: Then all resources by selector `$cssSelector` are valid on:$pages | ||
!-- DEPRECATED: 0.7.0, Then all resources found by $locatorType `$locator` are valid on:$pages | ||
Then all resources found by css selector `<cssSelector>` are valid on:<pages> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then all resources found by css selector `<cssSelector>` are valid on:<pages> | |
Then all resources found by CSS selector `<cssSelector>` are valid on:<pages> |
@@ -0,0 +1,8 @@ | |||
Composite: Then all resources by selector `$cssSelector` from $html are valid | |||
!-- DEPRECATED: 0.7.0, Then all resources found by $locatorType `$locator` in $html are valid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not a valid replacement pattern
|
||
|
||
Composite: Then all resources by selector `$cssSelector` are valid on:$pages | ||
!-- DEPRECATED: 0.7.0, Then all resources found by $locatorType `$locator` are valid on:$pages |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not a valid replacement pattern
public abstract Elements locate(String baseUri, String html, String locator); | ||
|
||
public Elements locate(String html, String locator) | ||
{ | ||
return locate("", html, locator); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public abstract Elements locate(String baseUri, String html, String locator); | |
public Elements locate(String html, String locator) | |
{ | |
return locate("", html, locator); | |
} | |
public abstract Elements findElements(String baseUri, String html, String locator); | |
public Elements findElements(String html, String locator) | |
{ | |
return findElements("", html, locator); | |
} |
Document document = mock(Document.class); | ||
Elements elements = mock(Elements.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Document document = mock(Document.class); | |
Elements elements = mock(Elements.class); | |
Document document = mock(); | |
Elements elements = mock(); |
this.description = description; | ||
} | ||
|
||
public abstract Elements findElements(String baseUri, String html, String locator); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public abstract Elements findElements(String baseUri, String html, String locator); | |
protected abstract Elements findElements(Document htmlDocument, String locator); | |
@Override | |
public Elements findElements(String baseUri, String html, String locator) | |
{ | |
return findElements(Jsoup.parse(html, baseUri), locator); | |
} |
or use Function
as a field
@@ -0,0 +1,8 @@ | |||
Composite: Then all resources by selector `$cssSelector` from $html are valid | |||
!-- DEPRECATED: 0.7.0, Then all resources found by $htmlLocatorType `$htmlLocator` in $html are valid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not a valid replacement pattern
|
||
|
||
Composite: Then all resources by selector `$cssSelector` are valid on:$pages | ||
!-- DEPRECATED: 0.7.0, Then all resources found by $htmlLocatorType `$htmlLocator` are valid on:$pages |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not a valid replacement pattern
3c901f6
to
db4a30c
Compare
db4a30c
to
e1787af
Compare
|
…n steps