Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Adding the skeleton for the test cases based on the skeleton from 7.x
Converting D7 SimpleTests to Drupal 8
Drupal SimpleTest coding standards
Now we have javascript testing in core we can write the tests using:
Javascript end-to-end testing added
PHPUnit Browser test tutorial
Comment | File | Size | Author |
---|---|---|---|
#125 | extlinktest-2587531-128.patch | 5.62 KB | elachlan |
| |||
#124 | extlinktest-2587531-126.patch | 5.31 KB | elachlan |
| |||
#122 | extlinktest-2587531-124.patch | 5.33 KB | elachlan |
#120 | extlinktest-2587531-122.patch | 5.38 KB | elachlan |
#118 | extlinktest-2587531-120.patch | 5.38 KB | elachlan |
Comments
Comment #2
elachlan CreditAttribution: elachlan commentedFirst Attempt.
Comment #3
elachlan CreditAttribution: elachlan commentedComment #5
elachlan CreditAttribution: elachlan commentedTrying again.
Comment #6
elachlan CreditAttribution: elachlan commentedComment #9
elachlan CreditAttribution: elachlan commentedRoll 3, should have paid more attention when copying/pasting.
Comment #11
elachlan CreditAttribution: elachlan commentedComment #13
elachlan CreditAttribution: elachlan commentedComment #15
elachlan CreditAttribution: elachlan commentedComment #17
Dane Powell CreditAttribution: Dane Powell at Acquia commentedAck, I didn't see that you had already started this, and I did my own upgrade of the simple tests from D7.
All this does is test that the admin path is accessible- the same as in D7, and your patch above. If you want to add actual checking of external link functionality, we can add that later once we have a stable testing base.
Comment #18
elachlan CreditAttribution: elachlan commentedI would really like to have the base class so that we can write tests a lot easier.
Re-rolled based on changes you made in your patch.
Comment #20
elachlan CreditAttribution: elachlan commentedComment #22
elachlan CreditAttribution: elachlan commentedI don't think its possible to write a test for detecting if an external link is present because it relies on javascript.
Which means we would have to wait for simpletest to finish:
#2469713: Step 2: Create a JavaScriptTestBase using PhantomJs Driver/Binary.
Comment #23
elachlan CreditAttribution: elachlan commentedWe might also want to convert the tests to BrowserTestBase.
https://www.drupal.org/node/2469723
Comment #24
elachlan CreditAttribution: elachlan commentedComment #25
elachlan CreditAttribution: elachlan commentedComment #26
elachlan CreditAttribution: elachlan commentedWe can start work on javascript tests now apparently.
Comment #27
elachlan CreditAttribution: elachlan commentedHere is my attempt at doing a test for checking if an external link is present.
Comment #29
elachlan CreditAttribution: elachlan commentedComment #30
elachlan CreditAttribution: elachlan commentedComment #32
elachlan CreditAttribution: elachlan commentedComment #34
elachlan CreditAttribution: elachlan commentedComment #37
borisson_Namespace and directory are not matching, so the testbot can't find any tests.
Either change the namespace to FunctionalJavascript or change the directory for the test to Functional.
None of the assertions here need js, so you should probably move that into a normal BTB test, as those are faster than the JS-tests.
Also, try to use
git diff -M
to create patches as that tracks moved files much better.Comment #38
elachlan CreditAttribution: elachlan commentedThanks for your help!
Comment #39
elachlan CreditAttribution: elachlan commentedComment #41
elachlan CreditAttribution: elachlan commentedComment #43
mradcliffeIt looks like user creation methods for functional javascript tests are moved into the UserCreationTrait::createUser.
Comment #44
elachlan CreditAttribution: elachlan commentedComment #46
elachlan CreditAttribution: elachlan commentedComment #48
elachlan CreditAttribution: elachlan commentedComment #50
elachlan CreditAttribution: elachlan commentedComment #52
elachlan CreditAttribution: elachlan commentedComment #54
elachlan CreditAttribution: elachlan commentedComment #56
elachlan CreditAttribution: elachlan commentedComment #58
elachlan CreditAttribution: elachlan commentedComment #60
elachlan CreditAttribution: elachlan commentedComment #62
elachlan CreditAttribution: elachlan commentedComment #64
elachlan CreditAttribution: elachlan commentedComment #66
elachlan CreditAttribution: elachlan commentedComment #68
elachlan CreditAttribution: elachlan commentedComment #70
elachlan CreditAttribution: elachlan commentedComment #72
elachlan CreditAttribution: elachlan commentedComment #74
elachlan CreditAttribution: elachlan commentedComment #76
angelamnr CreditAttribution: angelamnr commentedHi, I've been working on this a bit in my free time and I'm happy to help out.
Comment #77
elachlan CreditAttribution: elachlan commentedThanks for looking at it!
Comment #79
elachlan CreditAttribution: elachlan commentedComment #81
elachlan CreditAttribution: elachlan commentedComment #83
elachlan CreditAttribution: elachlan commentedComment #85
elachlan CreditAttribution: elachlan commentedI think we are closer. For some reason I think the page isn't loading properly.
I have been looking at examples like:
https://api.drupal.org/api/drupal/core%21modules%21book%21tests%21src%21...
There is a list that use createnode at:
https://api.drupal.org/api/drupal/core%21modules%21node%21tests%21src%21...
Comment #86
elachlan CreditAttribution: elachlan commentedComment #88
elachlan CreditAttribution: elachlan commentedComment #90
elachlan CreditAttribution: elachlan commentedComment #92
elachlan CreditAttribution: elachlan commentedComment #94
elachlan CreditAttribution: elachlan commentedComment #96
elachlan CreditAttribution: elachlan commentedComment #98
elachlan CreditAttribution: elachlan commentedComment #100
elachlan CreditAttribution: elachlan commentedComment #102
elachlan CreditAttribution: elachlan commentedScreenshot of the page that is being opened:
https://dispatcher.drupalci.org/job/drupal8_contrib_patches/27340/artifa...
Comment #104
elachlan CreditAttribution: elachlan commentedComment #106
elachlan CreditAttribution: elachlan commentedComment #108
elachlan CreditAttribution: elachlan commentedComment #110
elachlan CreditAttribution: elachlan commentedComment #112
elachlan CreditAttribution: elachlan commentedComment #113
elachlan CreditAttribution: elachlan commentedComment #114
elachlan CreditAttribution: elachlan commentedComment #116
elachlan CreditAttribution: elachlan commentedComment #118
elachlan CreditAttribution: elachlan commentedComment #120
elachlan CreditAttribution: elachlan commentedComment #122
elachlan CreditAttribution: elachlan commentedComment #124
elachlan CreditAttribution: elachlan commentedComment #125
elachlan CreditAttribution: elachlan commentedComment #126
elachlan CreditAttribution: elachlan commentedManaged to get it working, here is the screenshot from the test:
https://dispatcher.drupalci.org/job/drupal8_contrib_patches/27367/artifa...
Comment #128
elachlan CreditAttribution: elachlan commentedAdditional tests to be added in #2961572: Expand Javascript Functional Tests.