-
Notifications
You must be signed in to change notification settings - Fork 815
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5831528
commit 23c9811
Showing
7 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,10 @@ | ||
/node_modules | ||
/config/local* | ||
/config/tmp/* | ||
/output | ||
plan-data.txt | ||
e2e_tunnels.txt | ||
jetpack-private-options.txt | ||
/allure-results | ||
storage.json | ||
/tmp |
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 @@ | ||
module.exports = require( '_jetpack-e2e-commons/config/default.cjs' ); |
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,3 @@ | ||
import { makeE2eConfig } from '_jetpack-e2e-commons/eslint.config.mjs'; | ||
|
||
export default [ ...makeE2eConfig( import.meta.url ) ]; |
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,45 @@ | ||
{ | ||
"private": true, | ||
"type": "module", | ||
"description": "Security tools that keep your site safe and sound, from posts to plugins.", | ||
"homepage": "https://jetpack.com", | ||
"bugs": { | ||
"url": "https://github.com/Automattic/jetpack/labels/[Plugin] Protect" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/Automattic/jetpack.git", | ||
"directory": "projects/plugins/protect" | ||
}, | ||
"license": "GPL-2.0-or-later", | ||
"author": "Automattic", | ||
"scripts": { | ||
"build": "pnpm jetpack build plugins/protect plugins/jetpack -v --no-pnpm-install --production", | ||
"clean": "rm -rf output", | ||
"config:decrypt": "openssl enc -md sha1 -aes-256-cbc -d -pass env:CONFIG_KEY -in ./node_modules/_jetpack-e2e-commons/config/encrypted.enc -out ./config/local.cjs", | ||
"distclean": "rm -rf node_modules", | ||
"env:up": "e2e-env start --activate-plugins protect", | ||
"env:down": "e2e-env stop", | ||
"env:reset": "e2e-env reset --activate-plugins protect", | ||
"tunnel:up": "tunnel up", | ||
"tunnel:reset": "tunnel reset", | ||
"tunnel:down": "tunnel down", | ||
"pretest:run": "pnpm run clean", | ||
"test:run": ". ./node_modules/_jetpack-e2e-commons/bin/app-password.sh && playwright install --with-deps chromium && NODE_CONFIG_DIR='./config' ALLURE_RESULTS_DIR=./output/allure-results NODE_PATH=\"$PWD/node_modules\" playwright test --config=./playwright.config.mjs" | ||
}, | ||
"devDependencies": { | ||
"@playwright/test": "1.48.2", | ||
"allure-playwright": "2.9.2", | ||
"config": "3.3.12", | ||
"_jetpack-e2e-commons": "workspace:*" | ||
}, | ||
"browserslist": [], | ||
"ci": { | ||
"targets": [ | ||
"plugins/protect", | ||
"tools/e2e-commons" | ||
], | ||
"pluginSlug": "protect", | ||
"mirrorName": "jetpack-protect-plugin" | ||
} | ||
} |
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 @@ | ||
export { default } from '_jetpack-e2e-commons/config/playwright.config.default.mjs'; |
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,34 @@ | ||
import { prerequisitesBuilder } from '_jetpack-e2e-commons/env/prerequisites.js'; | ||
import { expect, test } from '_jetpack-e2e-commons/fixtures/base-test.js'; | ||
import logger from '_jetpack-e2e-commons/logger.js'; | ||
|
||
test.describe( 'Jetpack Protect plugin', () => { | ||
test.beforeEach( async ( { page } ) => { | ||
await prerequisitesBuilder( page ) | ||
.withCleanEnv() | ||
.withActivePlugins( [ 'protect' ] ) | ||
.withLoggedIn( true ) | ||
.build(); | ||
} ); | ||
|
||
test( 'Jetpack Protect admin page', async ( { page, admin } ) => { | ||
logger.action( 'Visit the Jetpack Protect admin page' ); | ||
|
||
await admin.visitAdminPage( 'admin.php', 'page=jetpack-protect' ); | ||
|
||
logger.action( 'Checking for heading "Stay one step ahead of threats"' ); | ||
await expect( | ||
page.getByRole( 'heading', { name: 'Stay one step ahead of threats' } ) | ||
).toBeVisible(); | ||
|
||
logger.action( 'Checking for button "Get Jetpack Protect"' ); | ||
const getJetpackProtectButton = page.getByRole( 'button', { name: 'Get Jetpack Protect' } ); | ||
await expect( getJetpackProtectButton ).toBeVisible(); | ||
await expect( getJetpackProtectButton ).toBeEnabled(); | ||
|
||
logger.action( 'Checking for button "Start for free"' ); | ||
const startForFreeButton = page.getByRole( 'button', { name: 'Start for free' } ); | ||
await expect( startForFreeButton ).toBeVisible(); | ||
await expect( startForFreeButton ).toBeEnabled(); | ||
} ); | ||
} ); |