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 testing setup #2177

Open
wants to merge 188 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
188 commits
Select commit Hold shift + click to select a range
30a9134
Update .gitignore
Mwalek Aug 5, 2024
524feb6
Add test env files
Mwalek Aug 5, 2024
2c722ff
Set up e2e tests
Mwalek Aug 6, 2024
bcfd2d9
Add setup directory
Mwalek Aug 6, 2024
557a996
Update Playwright setup
Mwalek Aug 6, 2024
355c5fd
Add helpers directory
Mwalek Aug 6, 2024
7196d73
Update Playwright config
Mwalek Aug 6, 2024
28e8a26
Downgrade Playwright
mrcasual Aug 6, 2024
88f98e1
Update Playwright to 1.45
mrcasual Aug 6, 2024
448b6a9
Use single quotes
Mwalek Aug 8, 2024
ac47375
Ignore report and result dirs
Mwalek Aug 8, 2024
7a4194f
Do not save report and results in setup dir
Mwalek Aug 8, 2024
4034b3a
Format code
mrcasual Aug 8, 2024
2be1856
Fix path
mrcasual Aug 8, 2024
96667d7
Use PHP 7.2 for E2E tests
mrcasual Aug 8, 2024
53d087c
Update sample .env file & GF folder variable
mrcasual Aug 8, 2024
7db15ff
Add initial E2E test [ci skip]
mrcasual Aug 8, 2024
cacbf97
Update Playwright to 1.46 [ci skip]
mrcasual Aug 9, 2024
0c59eaa
Downgrade Playwright
Mwalek Aug 12, 2024
a11cac9
Optimize WPAdminMenu test
Mwalek Aug 12, 2024
6526064
Ignore test-results
Mwalek Aug 12, 2024
3755ee5
Add form data importer
Mwalek Aug 13, 2024
56e864b
Ignore .imported-forms.json
Mwalek Aug 13, 2024
227550e
Add GravityView View Creation test
Mwalek Aug 13, 2024
99bb791
Add test for adding fields to GV view
Mwalek Aug 14, 2024
885eecd
Use camelcase standard for file naming
Mwalek Aug 14, 2024
cf912e8
Remove unnecessary login calls
Mwalek Aug 14, 2024
fe5a502
Refactor GV view field addition test
Mwalek Aug 14, 2024
4ef4666
Remove unnecessary log
Mwalek Aug 14, 2024
eebb4d9
Wait for navigation during view creation
Mwalek Aug 14, 2024
9725866
Use subfolder for related tests
Mwalek Aug 14, 2024
f0bdc3e
Add PHP importer script
Mwalek Aug 15, 2024
e541d17
Remove JS importer
Mwalek Aug 15, 2024
f8cb0a4
Add test helpers
Mwalek Aug 15, 2024
08cffcf
Add view creation tests
Mwalek Aug 15, 2024
94b2977
Refactor selectGravityFormByTitle
Mwalek Aug 15, 2024
1f0a5df
Use refactored selectGravityFormByTitle func
Mwalek Aug 15, 2024
623d089
Improve table template selector
Mwalek Aug 19, 2024
d2fc570
Add layout tests
Mwalek Aug 21, 2024
1fe4ab9
Remove debug code
Mwalek Aug 22, 2024
4b16619
Add local config plugin support
Mwalek Aug 22, 2024
e5d87ee
Ensure WebSocket connection regardless of State file presence
Mwalek Aug 22, 2024
70e0009
Catch flaky tests using retries
Mwalek Aug 22, 2024
b142add
Skip template tests if template is unavailable
Mwalek Aug 23, 2024
0b2d070
Add actual logic to verify correct layout display in FE
Mwalek Aug 23, 2024
28ba3d2
Skip tests if logged out
Mwalek Aug 26, 2024
cbdd102
Fix flaky add fields test
Mwalek Aug 27, 2024
2db1a70
Fix flaky view creation test
Mwalek Aug 28, 2024
1e73203
Add test to verify only approved entry display
Mwalek Aug 28, 2024
8009e2f
Verify admins can see all entries regardless of approval status
Mwalek Aug 28, 2024
074e4cb
Verify lightbox functionality in FE
Mwalek Aug 28, 2024
d3e4567
Remove unnecessary dotenv require statements
Mwalek Aug 28, 2024
d21b2f2
Use cli to import forms and entries
Mwalek Aug 29, 2024
ac12a18
Upgrade wp-env
Mwalek Aug 29, 2024
17a3e50
Add GF Import Helper
Mwalek Aug 29, 2024
c2cf535
Don't include importer in wp-env config
Mwalek Aug 29, 2024
6ff8c39
Improve gotoAndEnsureLoggedIn helper
Mwalek Aug 30, 2024
55f45a8
Fix form entry json sample schema
Mwalek Aug 30, 2024
da92bf1
Add more helper functions
Mwalek Aug 30, 2024
3961c7f
Add another sample json import file
Mwalek Aug 30, 2024
233dd8b
Add templates to test helpers
Mwalek Sep 2, 2024
69310f3
Add test form data
Mwalek Sep 2, 2024
900d53e
Add helper for counting entries
Mwalek Sep 2, 2024
81321ec
Add entries per page setting test
Mwalek Sep 2, 2024
85e3d22
Add test to verify hide empty fields setting
Mwalek Sep 2, 2024
88cf6cf
Add no entries form data
Mwalek Sep 2, 2024
a59d98e
Add test to verify no entries behavior
Mwalek Sep 2, 2024
876639a
Consistently use camel case for file names
Mwalek Sep 2, 2024
ed948ce
Add test to verify no entries custom message display
Mwalek Sep 2, 2024
072ec96
Add test to verify no results custom message
Mwalek Sep 2, 2024
64ba096
Add test to verify single entry title
Mwalek Sep 2, 2024
b414ee6
Add test to verify back link label text
Mwalek Sep 2, 2024
4f5c635
Add test to verify Update button text
Mwalek Sep 2, 2024
f0fa2ed
Add test to verify Cancel link text
Mwalek Sep 2, 2024
c41ab4c
Add test to verify delete link text
Mwalek Sep 2, 2024
a4190e5
Add test form data
Mwalek Sep 2, 2024
e70932c
Add test to verify redirect after editing entry
Mwalek Sep 2, 2024
7cad8ad
Add test to verify redirect after deleting entry
Mwalek Sep 2, 2024
ae5eeb5
Restructure tests folder
Mwalek Sep 2, 2024
deaffde
Optimize view creation test
Mwalek Sep 3, 2024
a737402
Simplify Lightbox functionality test
Mwalek Sep 3, 2024
7c98e4f
Optimize template selection test
Mwalek Sep 3, 2024
97a06de
Bump PHP minimum version to PHP 7.4
Mwalek Sep 3, 2024
daafc15
Resolve delete link locator strict mode violation
Mwalek Sep 4, 2024
a997480
Improve test helpers
Mwalek Sep 6, 2024
5fb3338
Improve entriesPerPageSetting test
Mwalek Sep 6, 2024
036824f
Add test form data
Mwalek Sep 6, 2024
6f59f87
Correct verifyHideEmptyFields test logic
Mwalek Sep 6, 2024
da6b974
Fix checkViewOnFrontEnd helper
Mwalek Sep 17, 2024
49fb286
Fix showAdminsAllEntries test
Mwalek Sep 17, 2024
593cede
Fix verifyApprovedEntriesDisplay test
Mwalek Sep 17, 2024
0feacf5
Skip test instead of throwing error if template is missing
Mwalek Sep 17, 2024
1b4f892
Use advanced regex in View creation test
Mwalek Sep 17, 2024
8baea47
Fix verifyApprovedEntriesDisplay test
Mwalek Sep 17, 2024
db54bc7
Ensure publish button is clickable
Mwalek Sep 23, 2024
64ce08c
Add test form data — user details
Mwalek Sep 23, 2024
18345d7
Add submit button to test data with improved formating
Mwalek Sep 23, 2024
4a8e232
Modify user details test data
Mwalek Sep 23, 2024
16d9c70
Add test to verify all fields display correctly in FE
Mwalek Sep 23, 2024
a863528
Move verify back link label test to correct directory
Mwalek Sep 23, 2024
76bc528
Add test to verify hidden fields in single entry layout
Mwalek Sep 23, 2024
9f27068
Remove redundant line from test
Mwalek Sep 24, 2024
07e08cd
Add test to verify Mark Entry As Read setting
Mwalek Sep 24, 2024
5f0f87a
Add colum sorting test
Mwalek Oct 4, 2024
19c3d61
Change column sorting test behavior
Mwalek Oct 4, 2024
3b38cfd
Add sort direction ASC test
Mwalek Oct 4, 2024
71e8152
Add sort direction DESC test
Mwalek Oct 4, 2024
db2842a
Use specified TEST_DIR if available
Mwalek Oct 8, 2024
8cf53c4
Add test form data
Mwalek Oct 8, 2024
1155cbb
Add secondary sort direction test
Mwalek Oct 8, 2024
2567e18
Add test to verify prevention of direct access
Mwalek Oct 9, 2024
af7424a
Remove redundant import error
Mwalek Oct 11, 2024
baff039
Fix prevent direct entry test
Mwalek Oct 14, 2024
18a64a3
Fix helper for checking View in front end
Mwalek Oct 14, 2024
8e42eaa
Add test form data
Mwalek Oct 14, 2024
77eda24
Modify test data
Mwalek Oct 15, 2024
99d203b
Revert change to helper sample permalink
Mwalek Oct 15, 2024
fa9e634
Fix prevent direct access test
Mwalek Oct 15, 2024
fe871b2
Add REST access disabled test
Mwalek Oct 15, 2024
effb38e
Add REST access enabled test
Mwalek Oct 15, 2024
631a97f
Improve test to verify all fields display
Mwalek Oct 15, 2024
419b439
Add test data
Mwalek Oct 15, 2024
07319ef
Use new data for Image Lightbox test
Mwalek Oct 15, 2024
1b3ed7e
Update entriesPerPageSetting test
Mwalek Oct 20, 2024
5b2867a
Add download helper
Mwalek Oct 22, 2024
a21bda1
Add test to allow View Export
Mwalek Oct 22, 2024
6a3b437
Add test to disallow View Export
Mwalek Oct 22, 2024
4ecc033
Remove redundant line
Mwalek Oct 22, 2024
3fc8342
Add tests to verify custom code
Mwalek Oct 25, 2024
6f0c2dd
Add createPageWithShortcode helper
Mwalek Oct 25, 2024
439449b
Merge branch 'develop' into basic-test-setup [ci skip]
mrcasual Nov 4, 2024
9852fa6
Format disallow export test
Mwalek Nov 18, 2024
4b86280
Add test to verify enhanced security
Mwalek Nov 18, 2024
9eede35
Merge branch 'develop' into basic-test-setup
Mwalek Nov 26, 2024
fbad2c5
Merge branch 'develop' into basic-test-setup
Mwalek Nov 28, 2024
d9e80e1
Merge branch 'develop' into basic-test-setup
Mwalek Dec 11, 2024
e8d58fb
Fix test to show admin all entries
Mwalek Dec 11, 2024
b30a9ab
Fix test that verifies approved entries display
Mwalek Dec 11, 2024
4596879
Add entry slug test
Mwalek Dec 12, 2024
d2460d5
Add descriptions to custom-code tests
Mwalek Dec 12, 2024
ba3f405
Add description to delete-entry test
Mwalek Dec 12, 2024
6c95376
Add descriptions to edit-entry tests
Mwalek Dec 12, 2024
c419425
Add descriptions to filter-sort tests
Mwalek Dec 12, 2024
ef5b147
Add description to layout test
Mwalek Dec 12, 2024
14e94c5
Add descriptions to multiple-entries tests
Mwalek Dec 12, 2024
e6e78af
Add descriptions to permissions tests
Mwalek Dec 12, 2024
d52cdb7
Add descriptions to single-entry tests
Mwalek Dec 12, 2024
025f25f
Add descriptions to view-creation tests
Mwalek Dec 12, 2024
25e35ca
Add test to ensure data is hidden before search
Mwalek Dec 12, 2024
2f49e21
Fix hideDataUntilSearch test
Mwalek Dec 16, 2024
3d55931
Add test for search clear button functionality
Mwalek Dec 16, 2024
cf886b4
Allow custom entry dates during form-entries import
Mwalek Dec 26, 2024
195d79a
Add custom entry dates to simple.json
Mwalek Dec 26, 2024
20cdcec
Skip already imported forms
Mwalek Dec 26, 2024
dfbf625
Add entry date search field test
Mwalek Dec 26, 2024
18f3b6f
Merge branch 'develop' into basic-test-setup
mrcasual Dec 26, 2024
c502788
Update dependencies
mrcasual Dec 28, 2024
766e1ef
Fix WP-CLI not working inside E2E Docker containers
mrcasual Dec 28, 2024
dfafd35
Skip tests if related forms are unavailable
Mwalek Dec 30, 2024
bb32bb4
Use testInfo in customCSS test
Mwalek Dec 30, 2024
c63a796
Remove console log
Mwalek Dec 30, 2024
4de16c3
Add testInfo to custom JS test
Mwalek Jan 3, 2025
91d4639
Add testInfo to multiple entries tests
Mwalek Jan 3, 2025
931cd2b
Skip View creation tests if no forms are available
Mwalek Jan 3, 2025
8305f8a
Reformat View creation tests
Mwalek Jan 3, 2025
a1dd452
Improve view URL locator
Mwalek Jan 6, 2025
eca719d
Add test for Entry ID search
Mwalek Jan 7, 2025
4664f12
Fix EntryDateField test
Mwalek Jan 7, 2025
eb30ff1
Add ability to star entries during import
Mwalek Jan 8, 2025
552a1e6
Star entry in the form 'Simple'
Mwalek Jan 8, 2025
2d5c227
Add Entry Starred Search test
Mwalek Jan 8, 2025
0f3c5ff
Add viewUrl helper
Mwalek Jan 9, 2025
364f5aa
Use viewUrl helper when checking view on front end
Mwalek Jan 9, 2025
07ded72
Improve getViewUrl logic
Mwalek Jan 9, 2025
ebba68a
Use new viewUrl helper
Mwalek Jan 9, 2025
e18417e
Use entryID based on pretty permalinks
Mwalek Jan 9, 2025
fc117fb
Add ability to mark imported entries as read
Mwalek Jan 9, 2025
d065376
Mark entry as read in simple test
Mwalek Jan 9, 2025
d2e7315
Add entry read filter test
Mwalek Jan 9, 2025
ab4fe91
Add entry unread filter test
Mwalek Jan 9, 2025
65ef8fb
Add dropdown select helper
Mwalek Jan 14, 2025
5f50a37
Reformat test helpers file
Mwalek Jan 14, 2025
3dbc109
Export dropdown select helper
Mwalek Jan 14, 2025
2a53b4c
Wait for permalink element before attempting to open url
Mwalek Jan 14, 2025
169e96d
Ensure idle network before navigating to View url
Mwalek Jan 14, 2025
6a740b2
Add form display test
Mwalek Jan 14, 2025
e0a3f81
Use test.step in custom CSS test
Mwalek Jan 17, 2025
0b588c0
Use test.step in custom JS test
Mwalek Jan 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use viewUrl helper when checking view on front end
Mwalek committed Jan 9, 2025
commit 364f5aab8464a18843d3855ad4a77f24d86e1ad2
11 changes: 3 additions & 8 deletions tests/E2E/helpers/test-helpers.js
Original file line number Diff line number Diff line change
@@ -204,15 +204,10 @@ async function publishView(page) {
* Helper function to check a newly created GravityView on the front end.
*
* @param {import('playwright').Page} page - The Playwright page object.
* @param {string} permalinkSelector - The CSS selector for the permalink element.
* @param {string} [permalinkSelector="#sample-permalink"] - The CSS selector for the permalink element.
*/
async function checkViewOnFrontEnd(
page,
permalinkSelector = "#sample-permalink",
) {
const viewUrl = await page.locator(`${permalinkSelector} a, ${permalinkSelector}`).evaluate((el) => {
return el.tagName === 'A' ? el.href : el.querySelector('a')?.href;
});
async function checkViewOnFrontEnd(page, permalinkSelector = "#sample-permalink") {
const viewUrl = await getViewUrl(page, permalinkSelector);
await page.goto(viewUrl);
await page.waitForURL(viewUrl);
await page.waitForLoadState("networkidle");