Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkShawn2020 committed Mar 31, 2024
1 parent 1fc1fd0 commit 8456fd9
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/core/download-card.action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import { chromium } from "playwright"
import internal from "stream"
import { sleep } from "../../packages/common-algo/utils"
import { IApi } from "../../packages/common-api/schema"
import { GEN_CARD_INPUT_PLACEHOLDER } from "../config/card"
import { env } from "../env"
Expand Down Expand Up @@ -50,10 +51,12 @@ export const downloadCardAction = async (
await page.getByPlaceholder(GEN_CARD_INPUT_PLACEHOLDER).fill(url)
console.log("-- to click generate button")
await page.getByRole("button", { name: /generate card/i }).click()
await page.waitForFunction(() => {
const h = document.getElementById("card-media")?.clientHeight
return !!h && h > 0
})
console.log("-- to wait card generated")
await sleep(3000)
// await page.waitForFunction(() => {
// const h = document.getElementById("card-media")?.clientHeight
// return !!h && h > 0
// })

console.log("-- to click download button")
await page
Expand Down

0 comments on commit 8456fd9

Please sign in to comment.