Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
The Simpletest PreviewTest needs to be converted to PHPUnit. The original test has tests that need to be covered in BrowserTestBase and had Ajax related tests that need to go into JavascriptTestBase.
This issue is split off from #2747167: Convert first part of web tests of views_ui.
Proposed resolution
Remaining tasks
Commit issues that this issue requires and is postponed on:
#2747167: Convert first part of web tests of views_ui
Comment | File | Size | Author |
---|---|---|---|
#17 | 2863563-17.patch | 41.89 KB | Lendude |
#17 | interdiff-2863563-14-17.txt | 637 bytes | Lendude |
#14 | 2863563-14.patch | 41.9 KB | Lendude |
#14 | interdiff-2863563-12-14.txt | 6.92 KB | Lendude |
#12 | 2863563-12.patch | 37.77 KB | Lendude |
Comments
Comment #2
michielnugter CreditAttribution: michielnugter as a volunteer and at Synetic commentedPatch with working tests if you apply the issues this one is postponed on. One of the postponed issues is applied to
Comment #3
michielnugter CreditAttribution: michielnugter as a volunteer and at Synetic commentedComment #6
michielnugter CreditAttribution: michielnugter as a volunteer and at Synetic commentedComment #10
LendudeWorked on this in a duplicate issue, lets move it here.
To quote myself for the other issue:
It turns out that ajax in preview doesn't actually work currently! It just shows the commands page when using any ajax link in preview. I can reproduce this in 8.7.x.
Quick test on a 8.5.3 site worked without issue so this might be a recent break.
Works fine when I do a fresh install using Unami, so my dev env was just broken
Comment #12
LendudeOk so it helps if you are on the view edit page and not on the preview page when working with the preview with ajax....and the test views actually 'use ajax'.
This is an attempt at a minimal conversion, hence all the helper methods, which we can probably do without.
Comment #14
Lendudeok so these views are used elsewhere, lets add some new ones.
Comment #15
jibranGreat work! Conversion looks good.
Comment #16
larowlannit two blank lines here
is this worth making a trait or in the base assert? it feels like a useful feature
Comment #17
LendudeThanks for the reviews!
#16.1 fixed
#16.2 nah I don't think so, I think the usual case is that a class is used to find the element you are looking for, so you are indirectly testing for it. Directly testing for the existence of a class is not very common I think. Not often where this is a functional requirement. Also, I think, we should keep the API to a minimum when we can, less to maintain.
Comment #18
jibranLet's see what Lee thinks about #17.2.
Comment #19
borisson_#17.2 - this could also be used to add testcoverage for #3013452: no_striping option for table rows is not respected, but only 1 other usecase not be sufficient to move this to a base class.
Comment #20
alexpottCommitted and pushed 97ac5b70c2 to 8.7.x and 5927122ab5 to 8.6.x. Thanks!
Unused use. Fixed on commit.