coordinate screenshots via data-id

This commit is contained in:
Loren Norman 2025-07-29 16:46:46 -04:00
parent 02dd9b9c1c
commit f463143199
2 changed files with 4 additions and 1 deletions

View file

@ -1,9 +1,11 @@
describe("Block Images", () => {
it("download all block images", () => {
cy.visit("http://localhost:5173/")
cy.get("[data-id]").each(($el) => {
cy.get("[data-id^='block-type-']").each(($el) => {
cy.wrap($el).rightclick({ force: true })
cy.contains("Save Block as PNG...").click()
}).then(blockElements => {
cy.log(`Saved ${blockElements.length} block images.`)
})
})
})

View file

@ -23,6 +23,7 @@ export default class WorkspaceExporter {
languageVersion: 0,
blocks: allBlocks.map((block, index) => ({
...block,
id: `block-type-${block.type}`,
x: 50,
y: 50*index
}))