-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test to verify enhanced security
- Loading branch information
Showing
2 changed files
with
28 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
tests/E2E/tests/permissions/enableEnhancedSecurity.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { test, expect } from '@playwright/test'; | ||
import { | ||
createPageWithShortcode, | ||
createView, | ||
gotoAndEnsureLoggedIn, | ||
publishView, | ||
templates, | ||
} from '../../helpers/test-helpers'; | ||
|
||
test('Verify Ehanced Security', async ({ page }, testInfo) => { | ||
await gotoAndEnsureLoggedIn(page, testInfo); | ||
await createView(page, { | ||
formTitle: 'Favorite Color', | ||
viewName: 'Verify Ehanced Security Test', | ||
template: templates[0], | ||
}); | ||
await publishView(page); | ||
const currentUrl = page.url(); | ||
const params = new URLSearchParams(new URL(currentUrl).search); | ||
const viewId = params.get('post'); | ||
const url = await createPageWithShortcode(page, { | ||
shortcode: `gravityview id="${viewId}"`, | ||
title: 'Verify Ehanced Security Test Page', | ||
}); | ||
await page.goto(url); | ||
const errorMessage = page.locator('text=Invalid View secret provided'); | ||
await expect(errorMessage).toBeVisible(); | ||
}); |