-
Notifications
You must be signed in to change notification settings - Fork 249
Fix experimental UI Build With Parameters ATHs #2561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,6 +49,11 @@ public BuildWithParameters enter(List<Parameter> definitions, Map<String, ?> val | |
| } | ||
|
|
||
| public void start() { | ||
| clickButton("Build"); | ||
| if (Boolean.getBoolean("new-job-page.flag.defaultValue")) { | ||
| find(by.xpath("//dialog[@open]//div[@id='bottom-sticker']//button[contains(., 'Build')]")) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| .click(); | ||
| } else { | ||
| clickButton("Build"); | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -367,7 +367,11 @@ public Build scheduleBuild(Map<String, ?> params) { | |
| // so wait for it to be added and then disappear | ||
| waitFor(waitFor(By.id("notification-bar"))).until(bar -> !bar.isDisplayed()); | ||
| } else { | ||
| clickLink("Build with Parameters"); | ||
| if (Boolean.getBoolean("new-job-page.flag.defaultValue")) { | ||
| clickButton("Build with Parameters"); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this no longer uses a new page but a dialog - as such the result of this is asynchronous and as such this must be using something like I say something like as I do not beleive there is currently something for "do something that will cause a dialog, when the dialog appears to this, then click the default button").
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this also needs to wait until it is scheduled = see the code comment above about the notification bar |
||
| } else { | ||
| clickLink("Build with Parameters"); | ||
| } | ||
| try { | ||
| BuildWithParameters paramsPage = new BuildWithParameters(this, new URL(driver.getCurrentUrl())); | ||
| paramsPage.enter(parameters, params).start(); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,6 +53,11 @@ public By path(String rel) { | |
| return super.path(rel); | ||
| } | ||
|
|
||
| if (Boolean.getBoolean("new-job-page.flag.defaultValue")) { | ||
| return by.xpath( | ||
| "//input[@name='name' and @value='%s']/parent::div[@name='parameter']//*[@name='%s']", name, rel); | ||
|
Comment on lines
+57
to
+58
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. time to add However the location structure is identical between the existing and experimental page?dialog vs standard page. |
||
| } | ||
|
|
||
| String np = driver.findElement(by.xpath("//input[@name='name' and @value='%s']", name)) | ||
| .getAttribute("path"); | ||
| String path = np.replaceAll("/name$", "") + "/" + rel; | ||
|
|
||
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.
My fear is that this is ok in testing while the "original" value of the property is false (when the flag value is coming from the default flag value, coming from the BooleanExperimentalFlag class). But when we change a flag default value (from the flag class itself) from false to true, this won't report the correct status of the flag.
This should be good enough for now but in mid-long term, we would need to have some sort of API in ATH to get the flag value.
cc @jtnord @janfaracik
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.
The value is per user so you would need to do this prior to every request prior to interacting.
It would be better if you can detect this from the page by the page doing something. or just assuming its false and click the button and then try the fallback (new way).
Anyway - this is another case of DO NOT DO THIS AT ALL... use a
data-test-idin the actual page for the button in both legacy and new cases - use the ID to get the button. no funny code changes. IE fix upstream.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.
the above comment is mostly moot as the build with parameters is not a page in the new UI so this code should be deprecated and the code put into the Build pageObject.