diff --git a/.wordpress-org/blueprints/blueprint.json b/.wordpress-org/blueprints/blueprint.json index 94a85f4a0..b72d790c7 100644 --- a/.wordpress-org/blueprints/blueprint.json +++ b/.wordpress-org/blueprints/blueprint.json @@ -1,6 +1,6 @@ { "$schema": "https://playground.wordpress.net/blueprint-schema.json", - "landingPage": "/wp-admin/admin.php?page=visualizer-setup-wizard&env=preview", + "landingPage": "\/wp-admin\/admin.php?page=visualizer-setup-wizard&env=preview&tab#step-1", "preferredVersions": { "php": "8.0", "wp": "latest" @@ -9,11 +9,6 @@ "networking": true }, "steps": [ - { - "step": "login", - "username": "admin", - "password": "password" - }, { "step": "installPlugin", "pluginZipFile": { @@ -23,6 +18,19 @@ "options": { "activate": true } + }, + { + "step": "wp-cli", + "command": "wp option update visualizer_fresh_install 1" + }, + { + "step": "wp-cli", + "command": "wp option delete visualizer-activated" + }, + { + "step": "login", + "username": "admin", + "password": "password" } ] } diff --git a/CHANGELOG.md b/CHANGELOG.md index 634176c75..e8606bb66 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +##### [Version 3.10.11](https://github.com/Codeinwp/visualizer/compare/v3.10.10...v3.10.11) (2024-04-01) + +### Fixes +- Updated internal dependencies +- Improved E2E testing + ##### [Version 3.10.10](https://github.com/Codeinwp/visualizer/compare/v3.10.9...v3.10.10) (2024-03-28) ### Fixes diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 13c4dfab2..edff76a28 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -436,3 +436,6 @@ Examples: > [!NOTE] > Make sure to respect the [schema](https://github.com/WordPress/wordpress-playground/blob/trunk/packages/playground/blueprints/public/blueprint-schema.json). You can validate your blueprint using a schema validator: [online](https://www.jsonschemavalidator.net/), [CLI](https://ajv.js.org/packages/ajv-cli.html) + +> [!NOTE] +> To test the blueprint, you can publish the branch and append the `blueprint.json` path to the URL: `https://playground.wordpress.net/?plugin=visualizer&blueprint-url=`. [Example](https://playground.wordpress.net/?plugin=visualizer&blueprint-url=https://raw.githubusercontent.com/Codeinwp/visualizer/fix/blueprint-redirect/.wordpress-org/blueprints/blueprint.json). diff --git a/classes/Visualizer/Plugin.php b/classes/Visualizer/Plugin.php index 2b64279ca..9d18143d9 100644 --- a/classes/Visualizer/Plugin.php +++ b/classes/Visualizer/Plugin.php @@ -28,7 +28,7 @@ class Visualizer_Plugin { const NAME = 'visualizer'; - const VERSION = '3.10.10'; + const VERSION = '3.10.11'; // custom post types const CPT_VISUALIZER = 'visualizer'; diff --git a/composer.lock b/composer.lock index ea4979938..e28045009 100644 --- a/composer.lock +++ b/composer.lock @@ -8,16 +8,16 @@ "packages": [ { "name": "codeinwp/themeisle-sdk", - "version": "3.3.15", + "version": "3.3.17", "source": { "type": "git", "url": "https://github.com/Codeinwp/themeisle-sdk.git", - "reference": "eb06ae687ee39cbcc316936db1349b8b1092e32f" + "reference": "b5698f21640d0156bd6777aa5c71e0704748755c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/eb06ae687ee39cbcc316936db1349b8b1092e32f", - "reference": "eb06ae687ee39cbcc316936db1349b8b1092e32f", + "url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/b5698f21640d0156bd6777aa5c71e0704748755c", + "reference": "b5698f21640d0156bd6777aa5c71e0704748755c", "shasum": "" }, "require-dev": { @@ -40,7 +40,11 @@ "keywords": [ "wordpress" ], - "time": "2024-03-26T09:05:18+00:00" + "support": { + "issues": "https://github.com/Codeinwp/themeisle-sdk/issues", + "source": "https://github.com/Codeinwp/themeisle-sdk/tree/v3.3.17" + }, + "time": "2024-04-01T07:35:31+00:00" }, { "name": "markbaker/complex", @@ -746,5 +750,5 @@ "platform-overrides": { "php": "5.6" }, - "plugin-api-version": "1.1.0" + "plugin-api-version": "2.6.0" } diff --git a/css/media.css b/css/media.css index f8c646a55..925c56f30 100644 --- a/css/media.css +++ b/css/media.css @@ -1,5 +1,5 @@ /* - Version: 3.10.10 + Version: 3.10.11 */ #visualizer-library-view { padding: 30px 10px 10px 30px; diff --git a/index.php b/index.php index ea27c3cc7..26794de72 100644 --- a/index.php +++ b/index.php @@ -3,7 +3,7 @@ Plugin Name: Visualizer: Tables and Charts for WordPress Plugin URI: https://themeisle.com/plugins/visualizer-charts-and-graphs/ Description: A simple, easy to use and quite powerful tool to create, manage and embed interactive charts into your WordPress posts and pages. The plugin uses Google Visualization API to render charts, which supports cross-browser compatibility (adopting VML for older IE versions) and cross-platform portability to iOS and new Android releases. - Version: 3.10.10 + Version: 3.10.11 Author: Themeisle Author URI: http://themeisle.com Requires at least: 5.2 diff --git a/package.json b/package.json index d52416f5a..73ffc67e1 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "visualizer", - "version": "3.10.10", + "version": "3.10.11", "description": "Visualizer Lite", "repository": { "type": "git", diff --git a/readme.txt b/readme.txt index 9b2047ef4..b54aa76dc 100755 --- a/readme.txt +++ b/readme.txt @@ -157,6 +157,15 @@ Pay attention that to turn your shortcodes into graphs, your theme has to have ` == Changelog == +##### [Version 3.10.11](https://github.com/Codeinwp/visualizer/compare/v3.10.10...v3.10.11) (2024-04-01) + +### Fixes +- Updated internal dependencies +- Improved E2E testing + + + + ##### [Version 3.10.10](https://github.com/Codeinwp/visualizer/compare/v3.10.9...v3.10.10) (2024-03-28) ### Fixes diff --git a/tests/e2e/specs/onboarding.spec.ts b/tests/e2e/specs/onboarding.spec.ts new file mode 100644 index 000000000..094d46d93 --- /dev/null +++ b/tests/e2e/specs/onboarding.spec.ts @@ -0,0 +1,86 @@ +/** + * WordPress dependencies + */ +import {test, expect} from '@wordpress/e2e-test-utils-playwright'; + +const { deleteAllCharts } = require('../utils/common'); + +async function setOption( page, optionName, optionValue ) { + await page.waitForSelector( `#${ optionName }` ); + const previousValue = await page.$eval( + `#${ optionName }`, + ( element ) => element.value + ); + + await page.focus( `#${ optionName }` ); + await page.type( `#${ optionName }`, optionValue ); + + await Promise.all( [ + page.click( '#Update' ), + page.waitForNavigation( { waitUntil: 'networkidle0' } ), + ] ); +} + +test.describe( 'Onboarding', () => { + + test.beforeEach( async ( { page, admin, requestUtils } ) => { + await deleteAllCharts( requestUtils ); + await admin.visitAdminPage( 'options.php' ); + await setOption( page,'visualizer_fresh_install', '1' ); + } ); + + test( 'Check the setup wizard', async ( { page, admin} ) => { + await admin.visitAdminPage( 'admin.php?page=visualizer-setup-wizard#step-1' ); + + // Step 1 + await expect(page.getByLabel('Pie/Donut chart', { exact: true })).toBeVisible(); + await page.getByLabel('Bar chart', { exact: true }).check(); + await expect(page.getByLabel('Line chart', { exact: true })).toBeVisible(); + await expect(page.getByLabel('Bar chart', { exact: true })).toBeVisible(); + await page.getByLabel('Next', { exact: true }).click(); + await page.getByLabel('Next', { exact: true }).click(); + await page.getByLabel('Next', { exact: true }).click(); + await page.getByLabel('Next', { exact: true }).click(); + await expect(page.getByText('Discover the power of PRO! 11')).toBeVisible(); + await expect(page.getByRole('button', { name: 'Save And Continue ' })).toBeVisible(); + await expect(page.getByRole('link', { name: ' Go to dashboard' })).toBeVisible(); + await page.getByRole('button', { name: 'Save And Continue ' }).click(); + + // Step 2 + await expect(page.getByLabel('You\'re almost done! We use').locator('h2')).toContainText('You\'re almost done!'); + await expect(page.getByRole('heading', { name: 'Importing demo data' })).toBeVisible(); + await expect(page.getByText('Done! Demo data imported')).toBeVisible(); + await expect(page.getByLabel('You\'re almost done! We use')).toContainText('Import data from other Charts, WordPress, DataBase, or Manual Data with Visualizer Premium version'); + await page.getByRole('button', { name: 'Continue ' }).click(); + + // Step 3 + await expect(page.getByRole('heading')).toContainText('Insert chart into the draft page'); + await expect(page.getByRole('button', { name: 'Create a draft page We will' })).toBeVisible(); + await page.getByRole('button', { name: 'Create a draft page We will' }).click(); + await expect(page.getByRole('heading', { name: 'Chart preview' })).toBeVisible(); + await page.getByRole('button', { name: 'Create a draft page We will' }).click(); + await page.getByRole('button', { name: 'Save And Continue ' }).click(); + + // Step 4 + await expect(page.getByRole('heading')).toContainText('Extra Features'); + await expect(page.getByRole('button', { name: 'Enable perfomance features' })).toBeVisible(); + await page.getByRole('button', { name: 'Enable perfomance features' }).click(); + await expect(page.getByLabel('Extra Features We\'re').getByRole('listitem')).toContainText('Improve your website speed and images by 80% with Optimole'); + await expect(page.getByRole('button', { name: 'Improve now' })).toBeVisible(); + await page.getByRole('checkbox').uncheck(); + await expect(page.getByLabel('Extra Features We\'re')).toContainText('Skip Improvement'); + await page.getByRole('button', { name: 'Skip Improvement' }).click(); + + // Step 5 + await expect(page.getByRole('heading')).toContainText('Updates, tutorials, special offers & more'); + await expect(page.getByLabel('Updates, tutorials, special')).toContainText('Get exclusive access of Visualizer newsletter'); + await expect(page.getByLabel('Updates, tutorials, special').locator('img')).toBeVisible(); + await expect(page.getByPlaceholder('test1@xx.com')).toBeVisible(); + await page.getByPlaceholder('test1@xx.com').click(); + await page.getByPlaceholder('test1@xx.com').fill('test@email.com'); + await expect(page.getByLabel('Updates, tutorials, special')).toContainText('Send Me Access'); + await expect(page.getByLabel('Updates, tutorials, special')).toContainText('Skip, Don’t give me access'); + await page.getByRole('button', { name: 'Skip, Don’t give me access' }).click(); + } ); + +} ); diff --git a/tests/e2e/specs/upsell.spec.js b/tests/e2e/specs/upsell.spec.js index a460f0e22..04898ed96 100644 --- a/tests/e2e/specs/upsell.spec.js +++ b/tests/e2e/specs/upsell.spec.js @@ -78,4 +78,15 @@ test.describe( 'Upsell', () => { searchParams = new URLSearchParams(href); expect( searchParams.get('utm_campaign') ).toBe('chart-permissions'); }); + + test( 'featured tab in Install Plugin (SDK)', async ( { admin, page } ) => { + await admin.visitAdminPage( 'plugin-install.php' ); + + // Those should be visible only when a PRO product is installed. + await expect( page.getByText('Image Optimization by Optimole') ).toBeHidden(); + await expect( page.locator('#the-list div').filter({ hasText: 'Otter Blocks' }).nth(1) ).toBeHidden(); + + await expect( page.getByLabel('Install Image Optimization by') ).toBeHidden(); + await expect( page.getByLabel('Install Otter Blocks') ).toBeHidden(); + }); } ); \ No newline at end of file