Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 2 additions & 3 deletions .distignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ composer.lock
npm-debug.log
bin
key.enc
cypress
cypress.json
node_modules
logs
grunt
Expand All @@ -36,9 +34,10 @@ assets/src
.wporg
.nvmrc
.github
cypress.config.js
.eslintrc
postcss.config.js
tailwind.config.js
phpstan.neon
development.php
playwright.config.ts
test-results
47 changes: 12 additions & 35 deletions .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,23 @@ on:
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
cancel-in-progress: true
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}

jobs:
e2e:
if: ( github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name ) && ( github.actor != 'dependabot[bot]' )
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: 16
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Configure Composer cache
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
cache: 'npm'
- name: Install dependencies
run: |
npm ci
composer install --no-dev --prefer-dist --no-progress --no-suggest
npx playwright install
- name: Make build
run: |
npm run build
Expand All @@ -48,23 +37,11 @@ jobs:
SSH_HOST: ${{ secrets.SSH_HOST }}
SSH_PATH: ${{ secrets.SSH_PATH }}
run: ./bin/run-e2e-tests.sh
- name: E2E tests chrome
uses: cypress-io/github-action@v6
with:
env: host=testing.optimole.com
config-file: cypress.config.js
browser: chrome
e2eFirefox:
needs: e2e
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 16
- uses: cypress-io/github-action@v6
with:
env: host=testing.optimole.com
config-file: cypress.config.js
browser: firefox
- name: Run E2E tests
id: run_tests
run: |
npm run e2e:run
continue-on-error: false
- name: Check test results
if: steps.run_tests.outcome != 'success'
run: exit 1
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ node_modules
logs
dist
artifact
cypress/videos
cypress/fixtures
vendor
code_quality
build
.DS_Store
cc-test-reporter
assets/build
assets/build
test-results
10 changes: 6 additions & 4 deletions assets/src/dashboard/parts/connected/settings/CloudLibrary.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,18 @@ export default function CloudLibrary( props ) {
} = props;

const storeData = useSelect( select => {
const { isLoading } = select( 'optimole' );
const { isLoading, isSubApiKey } = select( 'optimole' );
return {
isLoading: isLoading()
isLoading: isLoading(),
isSubApiKey: isSubApiKey()
};
}, []);

const { isLoading } = storeData;
const { isLoading, isSubApiKey } = storeData;


const isCloudLibraryEnabled = 'disabled' !== settings[ 'cloud_images' ];
const showSiteSelector = ! isSubApiKey && isCloudLibraryEnabled;
const whitelistedDomains = user_data.whitelist || [];


Expand Down Expand Up @@ -81,7 +83,7 @@ export default function CloudLibrary( props ) {

<hr className="my-8 border-grayish-blue"/>

{isCloudLibraryEnabled && (
{showSiteSelector && (
<BaseControl
label={options_strings.cloud_site_title}
help={options_strings.cloud_site_desc}
Expand Down
3 changes: 3 additions & 0 deletions assets/src/dashboard/store/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ const selectors = {
}

return state.logs;
},
isSubApiKey( state ) {
return state.apiKey && state.apiKey.startsWith( 'optml-s' );
}
};

Expand Down
15 changes: 0 additions & 15 deletions cypress.config.js

This file was deleted.

34 changes: 0 additions & 34 deletions cypress/.eslintrc.json

This file was deleted.

9 changes: 0 additions & 9 deletions cypress/.prettierrc.json

This file was deleted.

21 changes: 0 additions & 21 deletions cypress/e2e/test_amp.js

This file was deleted.

61 changes: 0 additions & 61 deletions cypress/e2e/test_beaver_builder_background_lazyload.js

This file was deleted.

Loading
Loading