Skip to content

Commit 790f603

Browse files
committed
use markdown to output
1 parent 66d0995 commit 790f603

File tree

5 files changed

+282
-277
lines changed

5 files changed

+282
-277
lines changed

.github/workflows/playwright.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ jobs:
3434
WP_PASSWORD: password
3535
STACKABLE_SLUG: Stackable/plugin
3636
run: npm run test
37+
- uses: markpatterson27/markdown-to-output@v1
38+
id: mto
39+
with:
40+
filepath: ./playwright-errors/errors.md
3741
- uses: actions/upload-artifact@v4
3842
if: ${{ !cancelled() }}
3943
id: artifact-upload-step
@@ -57,7 +61,7 @@ jobs:
5761
comment-id: ${{ steps.fc.outputs.comment-id }}
5862
issue-number: ${{ github.event.pull_request.number }}
5963
body: |
60-
$(cat ./playwright-errors/errors.md)
64+
${{ steps.mto.outputs.body }}
6165
## Playwright Report Artifact
6266
| file | commit |
6367
| ---- | ------ |

e2e/playwright.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ export default defineConfig( {
2323
/* Fail the build on CI if you accidentally left test.only in the source code. */
2424
// forbidOnly: !! process.env.CI,
2525
/* Retry on CI only */
26-
retries: process.env.CI ? 1 : 0,
26+
// retries: process.env.CI ? 1 : 0,
27+
retries: 0,
2728
// Locally, we could take advantage of parallelism due to multicore systems.
2829
// However, in the CI, we typically can use only one worker at a time.
2930
// It's more straightforward to align how we run tests in both systems.

e2e/tests/admin.spec.ts

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,67 @@
1-
import { test, expect } from 'e2e/test-utils'
1+
// import { test, expect } from 'e2e/test-utils'
22

3-
test( 'Activating Stackable should redirect to the Getting Started Page', async ( {
4-
page,
5-
admin,
6-
} ) => {
7-
await admin.visitAdminPage( 'plugins.php' )
3+
// test( 'Activating Stackable should redirect to the Getting Started Page', async ( {
4+
// page,
5+
// admin,
6+
// } ) => {
7+
// await admin.visitAdminPage( 'plugins.php' )
88

9-
const plugin = page.locator( `[data-plugin="${ process.env.STACKABLE_SLUG }.php"]` )
10-
// Deactivate Stackable
11-
const deactivate = plugin.getByLabel( 'Deactivate Stackable -' )
12-
await expect( deactivate ).toBeVisible()
13-
await deactivate.click()
9+
// const plugin = page.locator( `[data-plugin="${ process.env.STACKABLE_SLUG }.php"]` )
10+
// // Deactivate Stackable
11+
// const deactivate = plugin.getByLabel( 'Deactivate Stackable -' )
12+
// await expect( deactivate ).toBeVisible()
13+
// await deactivate.click()
1414

15-
// Activate Stackable
16-
const activate = plugin.getByLabel( 'Activate Stackable -' )
17-
await expect( activate ).toBeVisible()
18-
await activate.click()
15+
// // Activate Stackable
16+
// const activate = plugin.getByLabel( 'Activate Stackable -' )
17+
// await expect( activate ).toBeVisible()
18+
// await activate.click()
1919

20-
try {
21-
await expect( page ).toHaveURL( /stackable-getting-started/ )
22-
} catch {
23-
await expect( page ).toHaveURL( /page=stackable/ )
24-
await expect( page.getByRole( 'link', { name: 'Activate Free Version' } ) ).toBeVisible()
25-
await page.getByRole( 'link', { name: 'Activate Free Version' } ).click()
26-
await page.getByRole( 'link', { name: 'Skip', exact: true } ).click()
27-
await expect( page ).toHaveURL( /stackable-getting-started/ )
28-
}
29-
} )
20+
// try {
21+
// await expect( page ).toHaveURL( /stackable-getting-started/ )
22+
// } catch {
23+
// await expect( page ).toHaveURL( /page=stackable/ )
24+
// await expect( page.getByRole( 'link', { name: 'Activate Free Version' } ) ).toBeVisible()
25+
// await page.getByRole( 'link', { name: 'Activate Free Version' } ).click()
26+
// await page.getByRole( 'link', { name: 'Skip', exact: true } ).click()
27+
// await expect( page ).toHaveURL( /stackable-getting-started/ )
28+
// }
29+
// } )
3030

31-
test( 'Stackable settings should be saved', async ( {
32-
page,
33-
admin,
34-
stackable,
35-
} ) => {
36-
// Start waiting for Stackable Settings JSON Response before visiting the page
37-
let settings = null
38-
settings = stackable.waitForSettings()
31+
// test( 'Stackable settings should be saved', async ( {
32+
// page,
33+
// admin,
34+
// stackable,
35+
// } ) => {
36+
// // Start waiting for Stackable Settings JSON Response before visiting the page
37+
// let settings = null
38+
// settings = stackable.waitForSettings()
3939

40-
await admin.visitAdminPage( 'options-general.php?page=stackable' )
41-
// Make sure all Stackable settings are loaded
42-
await settings
40+
// await admin.visitAdminPage( 'options-general.php?page=stackable' )
41+
// // Make sure all Stackable settings are loaded
42+
// await settings
4343

44-
// Retrieves the value of the first option, toggles it and check if the value changed
45-
const option = page.locator( '.ugb-admin-toggle-setting' ).first().getByRole( 'switch' )
46-
const val = await option.getAttribute( 'aria-checked' )
44+
// // Retrieves the value of the first option, toggles it and check if the value changed
45+
// const option = page.locator( '.ugb-admin-toggle-setting' ).first().getByRole( 'switch' )
46+
// const val = await option.getAttribute( 'aria-checked' )
4747

48-
await option.click()
49-
const newVal = await option.getAttribute( 'aria-checked' )
48+
// await option.click()
49+
// const newVal = await option.getAttribute( 'aria-checked' )
5050

51-
expect( newVal ).not.toBe( val )
52-
await page.getByRole( 'button', { name: 'Save Changes' } ).click()
51+
// expect( newVal ).not.toBe( val )
52+
// await page.getByRole( 'button', { name: 'Save Changes' } ).click()
5353

54-
// Check if the value is correct after reloading
55-
settings = stackable.waitForSettings()
56-
await page.reload()
57-
await settings
54+
// // Check if the value is correct after reloading
55+
// settings = stackable.waitForSettings()
56+
// await page.reload()
57+
// await settings
5858

59-
const _option = page.locator( '.ugb-admin-toggle-setting' ).first().getByRole( 'switch' )
59+
// const _option = page.locator( '.ugb-admin-toggle-setting' ).first().getByRole( 'switch' )
6060

61-
await expect( _option ).toHaveAttribute( 'aria-checked', newVal )
61+
// await expect( _option ).toHaveAttribute( 'aria-checked', newVal )
6262

63-
// Revert back the settings to the original value
64-
await _option.click()
65-
await page.getByRole( 'button', { name: 'Save Changes' } ).click()
66-
await expect( _option ).toHaveAttribute( 'aria-checked', val )
67-
} )
63+
// // Revert back the settings to the original value
64+
// await _option.click()
65+
// await page.getByRole( 'button', { name: 'Save Changes' } ).click()
66+
// await expect( _option ).toHaveAttribute( 'aria-checked', val )
67+
// } )

e2e/tests/block-editor.spec.ts

Lines changed: 95 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,96 @@
1-
import { test, expect } from 'e2e/test-utils'
2-
3-
test.describe( 'Block Editor', () => {
4-
let pid = null
5-
6-
// Create Posts for testing
7-
test.beforeEach( async ( { editor, admin } ) => {
8-
await admin.createNewPost( { title: 'Block Editor Test' } )
9-
await editor.saveDraft()
10-
const postQuery = new URL( editor.page.url() ).search
11-
pid = new URLSearchParams( postQuery ).get( 'post' )
12-
} )
13-
14-
// Delete created post
15-
test.afterEach( async ( { requestUtils } ) => {
16-
await requestUtils.deletePost( pid )
17-
} )
18-
19-
test( 'Stackable blocks can be added in the editor', async ( {
20-
page,
21-
22-
editor,
23-
} ) => {
24-
await page.getByLabel( 'Toggle block inserter' ).click()
25-
26-
await page.locator( '.editor-block-list-item-stackable-text' ).click()
27-
28-
const blocks = await editor.getBlocks()
29-
30-
expect( blocks[ 0 ].name ).toContain( 'stackable/text' )
31-
} )
32-
33-
test( 'Stackable Inspector Controls should show up upon clicking a Stackable block', async ( {
34-
page,
35-
editor,
36-
} ) => {
37-
await editor.insertBlock( {
38-
name: 'stackable/text',
39-
} )
40-
41-
await editor.selectBlocks( editor.canvas.getByLabel( 'Block: Text' ) )
42-
await expect( page.getByLabel( 'Layout Tab' ) ).toBeVisible()
43-
await expect( page.getByLabel( 'Style Tab' ) ).toBeVisible()
44-
await expect( page.getByLabel( 'Advanced Tab' ) ).toBeVisible()
45-
} )
46-
47-
test( 'A Stackable block\'s attributes should update when settings are changed in the Inspector Controls.', async ( {
48-
page,
49-
editor,
50-
} ) => {
51-
await editor.insertBlock( {
52-
name: 'stackable/text',
53-
} )
54-
55-
// Add content and color to Stackable Text Block
56-
await editor.canvas.locator( '[data-type="stackable/text"] > .stk-block-text > p[role="textbox"]' ).fill( 'test' )
57-
await page.locator( '.stk-color-palette-control .stk-control-content > .components-dropdown > .components-button' ).first().click()
58-
await page.getByLabel( 'Hex color' ).fill( 'ff0000' )
59-
await editor.canvas.locator( 'body' ).click()
60-
61-
await expect( editor.canvas.locator( '[data-type="stackable/text"]' ) ).toContainText( 'test' )
62-
await expect( editor.canvas.locator( '[data-type="stackable/text"] > .stk-block-text > p[role="textbox"]' ) ).toHaveCSS( 'color', 'rgb(255, 0, 0)' )
63-
64-
await editor.saveDraft()
65-
66-
const blocks = await editor.getBlocks()
67-
const attributes = blocks[ 0 ].attributes
68-
69-
expect( attributes.textColor1 ).toBe( '#ff0000' )
70-
expect( attributes.text ).toBe( 'test' )
71-
} )
72-
73-
test( 'The Stackable block added in the editor should be visible in the frontend', async ( {
74-
editor,
75-
} ) => {
76-
await editor.insertBlock( {
77-
name: 'stackable/text',
78-
attributes: {
79-
text: 'test',
80-
textColor1: '#ff0000',
81-
},
82-
} )
83-
84-
const blocks = await editor.getBlocks()
85-
const uniqueId = blocks[ 0 ].attributes.uniqueId
86-
87-
await editor.saveDraft()
88-
89-
const preview = await editor.openPreviewPage()
90-
91-
await expect( preview.locator( `[data-block-id="${ uniqueId }"]` ) ).toBeVisible()
92-
await expect( preview.locator( `[data-block-id="${ uniqueId }"]` ) ).toContainText( 'test' )
93-
await expect( preview.locator( `[data-block-id="${ uniqueId }"] p` ) ).toHaveCSS( 'color', 'rgb(255, 0, 0)' )
94-
} )
95-
} )
1+
// import { test, expect } from 'e2e/test-utils'
2+
3+
// test.describe( 'Block Editor', () => {
4+
// let pid = null
5+
6+
// // Create Posts for testing
7+
// test.beforeEach( async ( { editor, admin } ) => {
8+
// await admin.createNewPost( { title: 'Block Editor Test' } )
9+
// await editor.saveDraft()
10+
// const postQuery = new URL( editor.page.url() ).search
11+
// pid = new URLSearchParams( postQuery ).get( 'post' )
12+
// } )
13+
14+
// // Delete created post
15+
// test.afterEach( async ( { requestUtils } ) => {
16+
// await requestUtils.deletePost( pid )
17+
// } )
18+
19+
// test( 'Stackable blocks can be added in the editor', async ( {
20+
// page,
21+
22+
// editor,
23+
// } ) => {
24+
// await page.getByLabel( 'Toggle block inserter' ).click()
25+
26+
// await page.locator( '.editor-block-list-item-stackable-text' ).click()
27+
28+
// const blocks = await editor.getBlocks()
29+
30+
// expect( blocks[ 0 ].name ).toContain( 'stackable/text' )
31+
// } )
32+
33+
// test( 'Stackable Inspector Controls should show up upon clicking a Stackable block', async ( {
34+
// page,
35+
// editor,
36+
// } ) => {
37+
// await editor.insertBlock( {
38+
// name: 'stackable/text',
39+
// } )
40+
41+
// await editor.selectBlocks( editor.canvas.getByLabel( 'Block: Text' ) )
42+
// await expect( page.getByLabel( 'Layout Tab' ) ).toBeVisible()
43+
// await expect( page.getByLabel( 'Style Tab' ) ).toBeVisible()
44+
// await expect( page.getByLabel( 'Advanced Tab' ) ).toBeVisible()
45+
// } )
46+
47+
// test( 'A Stackable block\'s attributes should update when settings are changed in the Inspector Controls.', async ( {
48+
// page,
49+
// editor,
50+
// } ) => {
51+
// await editor.insertBlock( {
52+
// name: 'stackable/text',
53+
// } )
54+
55+
// // Add content and color to Stackable Text Block
56+
// await editor.canvas.locator( '[data-type="stackable/text"] > .stk-block-text > p[role="textbox"]' ).fill( 'test' )
57+
// await page.locator( '.stk-color-palette-control .stk-control-content > .components-dropdown > .components-button' ).first().click()
58+
// await page.getByLabel( 'Hex color' ).fill( 'ff0000' )
59+
// await editor.canvas.locator( 'body' ).click()
60+
61+
// await expect( editor.canvas.locator( '[data-type="stackable/text"]' ) ).toContainText( 'test' )
62+
// await expect( editor.canvas.locator( '[data-type="stackable/text"] > .stk-block-text > p[role="textbox"]' ) ).toHaveCSS( 'color', 'rgb(255, 0, 0)' )
63+
64+
// await editor.saveDraft()
65+
66+
// const blocks = await editor.getBlocks()
67+
// const attributes = blocks[ 0 ].attributes
68+
69+
// expect( attributes.textColor1 ).toBe( '#ff0000' )
70+
// expect( attributes.text ).toBe( 'test' )
71+
// } )
72+
73+
// test( 'The Stackable block added in the editor should be visible in the frontend', async ( {
74+
// editor,
75+
// } ) => {
76+
// await editor.insertBlock( {
77+
// name: 'stackable/text',
78+
// attributes: {
79+
// text: 'test',
80+
// textColor1: '#ff0000',
81+
// },
82+
// } )
83+
84+
// const blocks = await editor.getBlocks()
85+
// const uniqueId = blocks[ 0 ].attributes.uniqueId
86+
87+
// await editor.saveDraft()
88+
89+
// const preview = await editor.openPreviewPage()
90+
91+
// await expect( preview.locator( `[data-block-id="${ uniqueId }"]` ) ).toBeVisible()
92+
// await expect( preview.locator( `[data-block-id="${ uniqueId }"]` ) ).toContainText( 'test' )
93+
// await expect( preview.locator( `[data-block-id="${ uniqueId }"] p` ) ).toHaveCSS( 'color', 'rgb(255, 0, 0)' )
94+
// } )
95+
// } )
9696

0 commit comments

Comments
 (0)