Merge pull request #31741 from woocommerce/fix/failing-daily-smoke-tests

Fix failing plugin tests in Smoke Test Daily workflow
This commit is contained in:
Jonathan Lane 2022-01-27 11:03:12 -08:00 committed by GitHub
commit 89a44ab8c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 25 additions and 15 deletions

View File

@ -88,7 +88,7 @@ jobs:
- plugin: 'WooCommerce PayPal Payments'
repo: 'woocommerce/woocommerce-paypal-payments'
- plugin: 'WooCommerce Shipping & Tax'
repo: 'woocommerce/woocommerce-services'
repo: 'automattic/woocommerce-services'
- plugin: 'WooCommerce Subscriptions'
repo: WC_SUBSCRIPTIONS_REPO
private: true

View File

@ -118,7 +118,7 @@ jobs:
- plugin: 'WooCommerce PayPal Payments'
repo: 'woocommerce/woocommerce-paypal-payments'
- plugin: 'WooCommerce Shipping & Tax'
repo: 'woocommerce/woocommerce-services'
repo: 'automattic/woocommerce-services'
- plugin: 'WooCommerce Subscriptions'
repo: WC_SUBSCRIPTIONS_REPO
private: true

View File

@ -1,5 +1,9 @@
# Unreleased
## Changed
- Updated top level menu css selectors
## Fixed
- Moved `merchant.login()` out of `beforeAll()` block and into test body for retried runs.

View File

@ -5,13 +5,9 @@
export const MENUS = [
[
'WooCommerce',
'#adminmenu > li:nth-child(8) > a',
'.menu-top > a[href*=wc-admin].menu-top-first',
[
[
'Home',
'',
'Home',
],
[ 'Home', '', 'Home' ],
[
'Orders',
'#toplevel_page_woocommerce > ul > li:nth-child(3) > a',
@ -37,7 +33,7 @@ export const MENUS = [
],
[
'Products',
'#adminmenu > li:nth-child(9) > a',
'.menu-top > a[href*=product].menu-top',
[
[
'All Products',
@ -68,7 +64,7 @@ export const MENUS = [
],
[
'Marketing',
'#adminmenu > li:nth-child(11) > a',
'.menu-top > a[href*=marketing].menu-top',
[
[
'Overview',

View File

@ -1,5 +1,8 @@
# Unreleased
## Changes
- Updated `deleteDownloadedPluginFiles()` to also be able to delete directories.
## Added
- Added `post-results-to-github-pr.js` to post smoke test results to a GitHub PR.

View File

@ -152,13 +152,20 @@ const downloadZip = async ( fileUrl, downloadPath, authorizationToken ) => {
const deleteDownloadedPluginFiles = async () => {
const pluginSavePath = resolveLocalE2ePath( 'plugins' );
fs.readdir( pluginSavePath, ( err, files ) => {
fs.readdir( pluginSavePath, ( err, contents ) => {
if ( err ) throw err;
for ( const file of files ) {
fs.unlink( path.join( pluginSavePath, file ), ( error ) => {
if ( error ) throw error;
} );
for ( const content of contents ) {
const contentPath = path.join( pluginSavePath, content );
const stats = fs.lstatSync( contentPath );
if ( stats.isDirectory() ) {
fs.rmSync( contentPath, { recursive: true, force: true } );
} else {
fs.unlink( contentPath, ( error ) => {
if ( error ) throw error;
} );
}
}
} );
};