Change plugin name to "Woo Subscriptions" in release and daily testing workflows (#40460)

* Update spec

* Update daily, release workflows

* Conditionally post slack summary

* Add changelog
This commit is contained in:
rodelgc 2023-11-15 23:08:47 +08:00 committed by GitHub
parent 05cfe2fe98
commit 62877a9d1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 46 additions and 58 deletions

View File

@ -178,7 +178,7 @@ jobs:
- plugin: 'WooCommerce Shipping & Tax'
repo: 'automattic/woocommerce-services'
slug: woocommerce-services
- plugin: 'WooCommerce Subscriptions'
- plugin: 'Woo Subscriptions'
repo: WC_SUBSCRIPTIONS_REPO
private: true
slug: woocommerce-subscriptions
@ -210,6 +210,7 @@ jobs:
env:
PLUGIN_REPOSITORY: ${{ matrix.private && secrets[matrix.repo] || matrix.repo }}
PLUGIN_NAME: ${{ matrix.plugin }}
PLUGIN_SLUG: ${{ matrix.slug }}
GITHUB_TOKEN: ${{ secrets.E2E_GH_TOKEN }}
- name: Run the rest of E2E tests
@ -322,7 +323,7 @@ jobs:
slug: woocommerce-paypal-payments
- plugin: 'WooCommerce Shipping & Tax'
slug: woocommerce-services
- plugin: 'WooCommerce Subscriptions'
- plugin: 'Woo Subscriptions'
slug: woocommerce-subscriptions
- plugin: 'Gutenberg'
slug: gutenberg
@ -350,6 +351,7 @@ jobs:
permissions:
contents: read
if: |
github.ref_name == 'trunk' &&
success() || (
failure() && contains( needs.*.result, 'failure' )
)

View File

@ -609,7 +609,7 @@ jobs:
- plugin: 'WooCommerce Shipping & Tax'
repo: 'automattic/woocommerce-services'
env_description: 'woocommerce-shipping-&-tax'
- plugin: 'WooCommerce Subscriptions'
- plugin: 'Woo Subscriptions'
repo: WC_SUBSCRIPTIONS_REPO
private: true
env_description: 'woocommerce-subscriptions'
@ -715,6 +715,7 @@ jobs:
permissions:
contents: read
if: |
github.ref_name == 'trunk' &&
success() || (
failure() && contains( needs.*.result, 'failure' )
)

View File

@ -0,0 +1,4 @@
Significance: patch
Type: dev
Update plugin name in testing workflows to "Woo Subscriptions".

View File

@ -3,10 +3,10 @@ const {
GITHUB_TOKEN,
PLUGIN_NAME,
PLUGIN_REPOSITORY,
PLUGIN_SLUG,
} = process.env;
const { test, expect } = require( '@playwright/test' );
const { admin } = require( '../../test-data/data' );
const path = require( 'path' );
const {
deletePlugin,
deleteZip,
@ -19,13 +19,13 @@ const deletePluginFromSite = async ( { request, baseURL } ) => {
await deletePlugin( {
request,
baseURL,
slug: pluginSlug,
slug: PLUGIN_SLUG,
username: admin.username,
password: admin.password,
} );
};
let pluginSlug, pluginPath;
let pluginPath;
test.skip( () => {
const shouldSkip = ! PLUGIN_REPOSITORY;
@ -41,39 +41,29 @@ test.describe( `${ PLUGIN_NAME } plugin can be uploaded and activated`, () => {
test.use( { storageState: ADMINSTATE } );
test.beforeAll( async ( { playwright, baseURL } ) => {
pluginSlug = path.basename( PLUGIN_REPOSITORY );
pluginPath = await test.step(
`Download ${ PLUGIN_NAME } plugin zip`,
async () => {
pluginPath =
await test.step( `Download ${ PLUGIN_NAME } plugin zip`, async () => {
return downloadZip( {
repository: PLUGIN_REPOSITORY,
authorizationToken: GITHUB_TOKEN,
} );
}
);
} );
await test.step(
"Delete plugin from test site if it's installed.",
async () => {
await deletePluginFromSite( {
request: playwright.request,
baseURL,
} );
}
);
await test.step( "Delete plugin from test site if it's installed.", async () => {
await deletePluginFromSite( {
request: playwright.request,
baseURL,
} );
} );
} );
test.afterAll( async ( { playwright, baseURL } ) => {
await test.step(
"Delete plugin from test site if it's installed.",
async () => {
await deletePluginFromSite( {
request: playwright.request,
baseURL,
} );
}
);
await test.step( "Delete plugin from test site if it's installed.", async () => {
await deletePluginFromSite( {
request: playwright.request,
baseURL,
} );
} );
await test.step( 'Delete the downloaded zip', async () => {
await deleteZip( pluginPath );
@ -81,25 +71,19 @@ test.describe( `${ PLUGIN_NAME } plugin can be uploaded and activated`, () => {
} );
test( `can upload and activate "${ PLUGIN_NAME }"`, async ( { page } ) => {
await test.step(
`Install "${ PLUGIN_NAME }" through WP CLI`,
async () => {
await installPluginThruWpCli( pluginPath );
}
);
await test.step( `Install "${ PLUGIN_NAME }" through WP CLI`, async () => {
await installPluginThruWpCli( pluginPath );
} );
await test.step( 'Go to the "Installed Plugins" page', async () => {
await page.goto( 'wp-admin/plugins.php' );
} );
await test.step(
`Expect "${ PLUGIN_NAME }" to be listed and active.`,
async () => {
await expect(
page.locator( `#deactivate-${ pluginSlug }` )
).toBeVisible();
}
);
await test.step( `Expect "${ PLUGIN_NAME }" to be listed and active.`, async () => {
await expect(
page.getByLabel( `Deactivate ${ PLUGIN_NAME }` )
).toBeVisible();
} );
await test.step( 'Expect the shop to load successfully.', async () => {
const shopHeading = page.getByRole( 'heading', {
@ -110,19 +94,16 @@ test.describe( `${ PLUGIN_NAME } plugin can be uploaded and activated`, () => {
await expect( shopHeading ).toBeVisible();
} );
await test.step(
'Expect the WooCommerce Homepage to load successfully.',
async () => {
const statsOverviewHeading = page.getByText( 'Stats overview' );
const skipSetupStoreLink = page.getByRole( 'button', {
name: 'Set up my store',
} );
await test.step( 'Expect the WooCommerce Homepage to load successfully.', async () => {
const statsOverviewHeading = page.getByText( 'Stats overview' );
const skipSetupStoreLink = page.getByRole( 'button', {
name: 'Set up my store',
} );
await page.goto( '/wp-admin/admin.php?page=wc-admin' );
await expect(
statsOverviewHeading.or( skipSetupStoreLink )
).toBeVisible();
}
);
await page.goto( '/wp-admin/admin.php?page=wc-admin' );
await expect(
statsOverviewHeading.or( skipSetupStoreLink )
).toBeVisible();
} );
} );
} );