Skip to content
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

Add screenshot tests for the new registrar console #2577

Merged
merged 1 commit into from
Oct 9, 2024

Conversation

gbrodman
Copy link
Collaborator

@gbrodman gbrodman commented Oct 1, 2024

This required updating to a newer version of Selenium, building the console dist/ folder, and serving that folder.


This change is Reviewable

Copy link
Collaborator

@ptkach ptkach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 12 of 95 files at r1, all commit messages.
Reviewable status: 12 of 95 files reviewed, 2 unresolved discussions (waiting on @gbrodman)


core/src/test/java/google/registry/webdriver/ConsoleScreenshotTest.java line 41 at r1 (raw file):

 * because we aren't really serving the webapp the same way that an actual webserver (e.g. Express)
 * would, we're just statically serving the distribution. As a result, we cannot load URLs, e.g.
 * "/#/settings", directly.

Can you elaborate on why we can't load URLs? All navigation happens within the webapp via angular router, so as long as URL is correct, webapp should handle it.


core/src/test/java/google/registry/webdriver/ConsoleScreenshotTest.java line 43 at r1 (raw file):

 * "/#/settings", directly.
 */
public class ConsoleScreenshotTest extends WebDriverTestCase {

Hmm all those retries and sleeps make me a uneasy about this approach. Is it possible to replace with something more explicit, like:

WebDriverWait(driver, 10).until(
        EC.presence_of_element_located((By.ID, "myDynamicElement"))

Code quote:

T

Copy link
Collaborator Author

@gbrodman gbrodman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 12 of 95 files reviewed, 2 unresolved discussions (waiting on @ptkach)


core/src/test/java/google/registry/webdriver/ConsoleScreenshotTest.java line 41 at r1 (raw file):

Previously, ptkach (Pavlo Tkach) wrote…

Can you elaborate on why we can't load URLs? All navigation happens within the webapp via angular router, so as long as URL is correct, webapp should handle it.

It's because that routing depends on the existence of the express (?) server than handles routing in general, that anything under /console should go to the console routing service. Here we're dealing with the raw pages (like, we're loading /console/index.html directly) we can't count on any routing.


core/src/test/java/google/registry/webdriver/ConsoleScreenshotTest.java line 43 at r1 (raw file):

Previously, ptkach (Pavlo Tkach) wrote…

Hmm all those retries and sleeps make me a uneasy about this approach. Is it possible to replace with something more explicit, like:

WebDriverWait(driver, 10).until(
        EC.presence_of_element_located((By.ID, "myDynamicElement"))

The issue is that much of the time we're waiting on an effect (like a highlighting, or a shadow) to fade to make sure we can get a reliable constant color/image. Otherwise, we end up with e.g. spurious failures caused by slight degrees of a button's highlighting fading after we click on it.

@gbrodman
Copy link
Collaborator Author

gbrodman commented Oct 7, 2024

gonna wait until approval to fix the merge conflicts in the lockfiles, to avoid extra work

Copy link
Collaborator

@ptkach ptkach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool, thanks! How does it compare to the old console wrt running time? Is it faster?

Reviewed 83 of 95 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @gbrodman)

Copy link
Collaborator Author

@gbrodman gbrodman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems pretty similar!

Reviewable status: 81 of 95 files reviewed, all discussions resolved (waiting on @ptkach)

This required updating to a newer version of Selenium, building the
console dist/ folder, and serving that folder.
@jianglai jianglai added the kokoro:force-run Force a Kokoro build. label Oct 9, 2024
@domain-registry-eng domain-registry-eng removed the kokoro:force-run Force a Kokoro build. label Oct 9, 2024
@gbrodman gbrodman added this pull request to the merge queue Oct 9, 2024
Merged via the queue into google:master with commit c32fb2f Oct 9, 2024
10 of 11 checks passed
@gbrodman gbrodman deleted the screenshots branch October 9, 2024 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants