Skip to content

Commit

Permalink
worked on tests
Browse files Browse the repository at this point in the history
  • Loading branch information
LiveDuo committed Nov 5, 2023
1 parent 3ad8131 commit e74cc25
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions e2e/dev-react/dev.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,21 @@ test('should contain the editor', async ({ page }) => {
})

// TODO fix
test.skip('should drap and drop a component', async ({ page }) => {
test('should drap and drop a component', async ({ page }) => {
await page.goto('/')

// open category
await page.click('#banner')

Check failure on line 13 in e2e/dev-react/dev.spec.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

[Desktop Firefox] › dev.spec.ts:9:5 › should drap and drop a component

1) [Desktop Firefox] › dev.spec.ts:9:5 › should drap and drop a component ──────────────────────── Error: page.click: Target closed =========================== logs =========================== waiting for locator('#banner') ============================================================ 11 | 12 | // open category > 13 | await page.click('#banner') | ^ 14 | 15 | // add component 16 | const imagePath = at /home/runner/work/destack/destack/e2e/dev-react/dev.spec.ts:13:14

Check failure on line 13 in e2e/dev-react/dev.spec.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

[Desktop Firefox] › dev.spec.ts:9:5 › should drap and drop a component

1) [Desktop Firefox] › dev.spec.ts:9:5 › should drap and drop a component ──────────────────────── Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: page.click: Target closed =========================== logs =========================== waiting for locator('#banner') ============================================================ 11 | 12 | // open category > 13 | await page.click('#banner') | ^ 14 | 15 | // add component 16 | const imagePath = at /home/runner/work/destack/destack/e2e/dev-react/dev.spec.ts:13:14

// add component
const imagePath =
'http://localhost:12785/api/builder/handle?type=asset&path=/themes/hyperui/Banner1/preview.png'
await page.dragAndDrop(`img[src='${imagePath}']`, '#editor > div')
await expect(page.locator('#editor > div')).toHaveCount(1)
'http://localhost:12785/api/builder/handle?type=asset&path=/themes/HyperUI/Banner1/preview.png'
await page.dragAndDrop(`img[src='${imagePath}']`, '#editor')
await page.isVisible("text='Understand User Flow'")

// remove the component
await page.hover('text=Understand')
await page.click('div.page-container a:nth-child(4)')
// await page.click('#delete')
})

test.skip('should add an image to renderer', async ({ page }) => {
Expand Down
2 changes: 1 addition & 1 deletion e2e/dev/dev.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ test('should contain the editor', async ({ page }) => {
})

// TODO fix
test.skip('should drap and drop a component', async ({ page }) => {
test('should drap and drop a component', async ({ page }) => {
await page.goto('/')

// open category
Expand Down

0 comments on commit e74cc25

Please sign in to comment.