Problem/Motivation

Currently the module still contains some web tests provided by the simpletest module.

Proposed resolution

Convert web tests to Functional tests.

Comments

JeroenT created an issue. See original summary.

jeroent’s picture

Issue summary: View changes
jeroent’s picture

Issue tags: +DevDaysCluj

Status: Needs review » Needs work

The last submitted patch, convert_simpletests_to_phpunit_tests.patch, failed testing. View results

jeroent’s picture

jeroent’s picture

Status: Needs work » Needs review
StatusFileSize
new8.28 KB
new29.12 KB

Status: Needs review » Needs work

The last submitted patch, 6: convert_simpletests_to_phpunit_tests-6.patch, failed testing. View results

jeroent’s picture

The FunctionalJavascript test is currently failing. Hard to debug when the tests pass locally...

jeroent’s picture

Status: Needs work » Needs review
StatusFileSize
new29.11 KB
new1.47 KB

Status: Needs review » Needs work

The last submitted patch, 9: convert_simpletests_to_phpunit_tests-8.patch, failed testing. View results

jeroent’s picture

Status: Needs work » Needs review
StatusFileSize
new29.25 KB

Status: Needs review » Needs work

The last submitted patch, 11: convert_simpletests_to_phpunit_tests-9.patch, failed testing. View results

jeroent’s picture

jeroent’s picture

Status: Needs work » Needs review
StatusFileSize
new29.33 KB

Status: Needs review » Needs work

The last submitted patch, 14: convert_simpletests_to_phpunit_tests-14.patch, failed testing. View results

jeroent’s picture

jeroent’s picture

jeroent’s picture

Status: Needs work » Needs review
StatusFileSize
new29.18 KB

Status: Needs review » Needs work

The last submitted patch, 18: convert_simpletests_to_phpunit_tests-17.patch, failed testing. View results

jeroent’s picture

jeroent’s picture

jeroent’s picture

aohrvetpv’s picture

I can try later to see if your patch works for me locally.

Once I had a test failure on Drupal.org that I couldn't reproduce locally. After very many patch attempts I figured out it was a timing issue, where two things happened faster on Drupal.org, such that locally they happened with a different timestamp (a different second), but on Drupal.org they happened with the same timestamp (in the same second).

I doubt it is the same issue here but thought I'd mention it just in case. Maybe different browser versions with this issue? It looked like these tests are using some specific version of Chrome.

Thanks for doing this tests conversion, it is a big contribution.

jeroent’s picture

@AohRveTPV, turns out on my machine the tests only work with chromedriver 74...

jeroent’s picture

Allright, this test should pass. Most of the tests were pretty straight forward to convert, but the PasswordHistoryTests is a complete rewrite.

aohrvetpv’s picture

Thanks, this is great.

#25 seems to combine (1) converting away from SimpleTest, and (2) making formatting improvements (e.g. converting to single quotes for consistency). I think it might be clearer to break into separate patches. I can split it later.

The History constraint behavior ought to be changed per #2867320: Password Policy History module wrong behaviour, in my opinion. The test logic will probably need to be adjusted for that, so I'm not going to review it too closely for now.

aohrvetpv’s picture

Title: Convert simpletest to BrowserTests. » Convert simpletest to BrowserTests
aohrvetpv’s picture

Committed a change to convert all double quotes in string literals of tests to single quotes.

Updated the patch accordingly, and removed a couple formatting improvements that were unrelated to this conversion. Doing so makes it easier to see in the patch/commit precisely which changes were made to convert to PHPUnit tests. (I'm apparently not the only one who thinks this is a good idea--see #7 under "Extended instructions for converting a DrupalWebTestCase test" at https://www.drupal.org/docs/8/testing/converting-d7-simpletests-to-drupal-8)

aohrvetpv’s picture

Status: Needs review » Needs work

Gendered language on password_policy_history/tests/src/FunctionalJavascript/PasswordHistoryTest.php:128.

aohrvetpv’s picture

Status: Needs work » Needs review
StatusFileSize
new958 bytes
new27.62 KB

- Removed gendered language.
- Corrected incorrect article "an" to "a".
- Changed drupalget() to drupalGet() for consistency. (Unsure how that's working in all lowercase.)

  • AohRveTPV committed 4aa08a7 on 8.x-3.x authored by JeroenT
    Issue #3061196 by JeroenT, AohRveTPV: Convert simpletest to BrowserTests
    
aohrvetpv’s picture

Status: Needs review » Fixed

Thanks Jereon.

rosinegrean’s picture

Issue tags: -DevDaysCluj +DevDaysTransylvania

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.