New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 606815 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Nov 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: iOS
Pri: 2
Type: Bug



Sign in to add a comment

Refactor EarlGrey test utilities into re-usable pieces

Project Member Reported by baxley@chromium.org, Apr 26 2016

Issue description

We'd like to share test utilities across the web shell and Chrome, where possible.

Don't create a long list of random static methods to do anything tests want to do.
Create it in a way that code can be used across Chrome and the web shell.

The initial thought is to have a base class, then derived classes that implement common pieces that are implemented differently (e.g. accessing WebState) on different apps. Alternatively, if it is just the WebState, this could be passed in upon initialization.

Using static methods is also a possibility that should be considered, but would make it harder to reinforce good design as methods are added later.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Apr 26 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/66c47ace248ec6f45ca298d4669cff7bc61ceda3

commit 66c47ace248ec6f45ca298d4669cff7bc61ceda3
Author: baxley <baxley@chromium.org>
Date: Tue Apr 26 18:59:46 2016

Move web shell test support into a separate target.

Test utilities should not be a part of the test case target.

BUG= 606815 

Review URL: https://codereview.chromium.org/1922633003

Cr-Commit-Position: refs/heads/master@{#389833}

[modify] https://crrev.com/66c47ace248ec6f45ca298d4669cff7bc61ceda3/ios/web/ios_web_shell_tests.gyp

Project Member

Comment 2 by bugdroid1@chromium.org, May 5 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/695a50d9ba4ec6f761f02783211fc8925d29678a

commit 695a50d9ba4ec6f761f02783211fc8925d29678a
Author: baxley <baxley@chromium.org>
Date: Thu May 05 23:33:25 2016

Refactor web shell integration tests utilities.

Decouple the test code so web view test code can be shared
across the web shell and Chrome.

BUG= 606815 

Review-Url: https://codereview.chromium.org/1950323002
Cr-Commit-Position: refs/heads/master@{#391949}

[modify] https://crrev.com/695a50d9ba4ec6f761f02783211fc8925d29678a/ios/web/BUILD.gn
[modify] https://crrev.com/695a50d9ba4ec6f761f02783211fc8925d29678a/ios/web/ios_web.gyp
[modify] https://crrev.com/695a50d9ba4ec6f761f02783211fc8925d29678a/ios/web/ios_web_shell_tests.gyp
[add] https://crrev.com/695a50d9ba4ec6f761f02783211fc8925d29678a/ios/web/public/test/earl_grey/web_view_matchers.h
[rename] https://crrev.com/695a50d9ba4ec6f761f02783211fc8925d29678a/ios/web/public/test/earl_grey/web_view_matchers.mm
[add] https://crrev.com/695a50d9ba4ec6f761f02783211fc8925d29678a/ios/web/public/test/navigation_test_util.h
[add] https://crrev.com/695a50d9ba4ec6f761f02783211fc8925d29678a/ios/web/public/test/navigation_test_util.mm
[add] https://crrev.com/695a50d9ba4ec6f761f02783211fc8925d29678a/ios/web/shell/test/app/web_shell_test_util.h
[add] https://crrev.com/695a50d9ba4ec6f761f02783211fc8925d29678a/ios/web/shell/test/app/web_shell_test_util.mm
[rename] https://crrev.com/695a50d9ba4ec6f761f02783211fc8925d29678a/ios/web/shell/test/earl_grey/shell_matchers.h
[rename] https://crrev.com/695a50d9ba4ec6f761f02783211fc8925d29678a/ios/web/shell/test/earl_grey/shell_matchers.mm
[delete] https://crrev.com/64e998f22313af5a6375849f2c30673817f82220/ios/web/shell/test/navigation_test_util.h
[delete] https://crrev.com/64e998f22313af5a6375849f2c30673817f82220/ios/web/shell/test/navigation_test_util.mm
[modify] https://crrev.com/695a50d9ba4ec6f761f02783211fc8925d29678a/ios/web/shell/test/web_shell_navigation_egtest.mm
[delete] https://crrev.com/64e998f22313af5a6375849f2c30673817f82220/ios/web/shell/test/web_shell_test_util.h
[delete] https://crrev.com/64e998f22313af5a6375849f2c30673817f82220/ios/web/shell/test/web_shell_test_util.mm
[delete] https://crrev.com/64e998f22313af5a6375849f2c30673817f82220/ios/web/shell/test/web_view_matchers.h

Comment 3 by baxley@chromium.org, Dec 14 2016

Status: Assigned (was: Started)
Status: Started (was: Assigned)
Project Member

Comment 5 by bugdroid1@chromium.org, Jun 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/13e2e2298a89381e70458ef8b733e4996861b2ae

commit 13e2e2298a89381e70458ef8b733e4996861b2ae
Author: Mike Baxley <baxley@chromium.org>
Date: Tue Jun 13 22:12:22 2017

Share test helpers between settings tests.

Create matchers for content settings, and settings back button.
Update settings tests to use these matchers. Additionally, use
ChromeEarlGreyUI tapSettingsMenuButton, instead of manually scrolling
and tapping the menu.

Bug:  606815 
Change-Id: Ib5555510df2cc6cbda67223354f7616d5d70712c
Reviewed-on: https://chromium-review.googlesource.com/530088
Reviewed-by: Louis Romero <lpromero@chromium.org>
Reviewed-by: Kurt Horimoto <kkhorimoto@chromium.org>
Commit-Queue: Mike Baxley <baxley@chromium.org>
Cr-Commit-Position: refs/heads/master@{#479174}
[modify] https://crrev.com/13e2e2298a89381e70458ef8b733e4996861b2ae/ios/chrome/browser/ui/first_run/first_run_egtest.mm
[modify] https://crrev.com/13e2e2298a89381e70458ef8b733e4996861b2ae/ios/chrome/browser/ui/settings/autofill_settings_egtest.mm
[modify] https://crrev.com/13e2e2298a89381e70458ef8b733e4996861b2ae/ios/chrome/browser/ui/settings/block_popups_egtest.mm
[modify] https://crrev.com/13e2e2298a89381e70458ef8b733e4996861b2ae/ios/chrome/browser/ui/settings/settings_egtest.mm
[modify] https://crrev.com/13e2e2298a89381e70458ef8b733e4996861b2ae/ios/chrome/browser/ui/settings/translate_ui_egtest.mm
[modify] https://crrev.com/13e2e2298a89381e70458ef8b733e4996861b2ae/ios/chrome/test/earl_grey/chrome_matchers.h
[modify] https://crrev.com/13e2e2298a89381e70458ef8b733e4996861b2ae/ios/chrome/test/earl_grey/chrome_matchers.mm

Comment 6 by baxley@chromium.org, Nov 16 2017

Status: Fixed (was: Started)

Sign in to add a comment