coordinate screenshots via data-id
This commit is contained in:
parent
02dd9b9c1c
commit
f463143199
2 changed files with 4 additions and 1 deletions
|
|
@ -1,9 +1,11 @@
|
||||||
describe("Block Images", () => {
|
describe("Block Images", () => {
|
||||||
it("download all block images", () => {
|
it("download all block images", () => {
|
||||||
cy.visit("http://localhost:5173/")
|
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.wrap($el).rightclick({ force: true })
|
||||||
cy.contains("Save Block as PNG...").click()
|
cy.contains("Save Block as PNG...").click()
|
||||||
|
}).then(blockElements => {
|
||||||
|
cy.log(`Saved ${blockElements.length} block images.`)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ export default class WorkspaceExporter {
|
||||||
languageVersion: 0,
|
languageVersion: 0,
|
||||||
blocks: allBlocks.map((block, index) => ({
|
blocks: allBlocks.map((block, index) => ({
|
||||||
...block,
|
...block,
|
||||||
|
id: `block-type-${block.type}`,
|
||||||
x: 50,
|
x: 50,
|
||||||
y: 50*index
|
y: 50*index
|
||||||
}))
|
}))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue