force enable weather block before screenshots

This commit is contained in:
Loren Norman 2025-07-30 15:24:15 -04:00
parent 03ee183cc3
commit 85d2a31006
2 changed files with 12 additions and 1 deletions

View file

@ -1,6 +1,16 @@
describe("Block Images", () => {
it("download all block images", () => {
cy.visit("http://localhost:5173/")
// any extra setup to do before taking screenshots
cy.window().then(win => {
// disable the weather block's automatic disabling behavior
const weatherBlock = win.blocklyWorkspace.getBlockById('block-type-weather')
weatherBlock.autoDisable = false
// enable it
weatherBlock.setEnabled(true)
})
cy.get("[data-id^='block-type-']").each(($el) => {
cy.wrap($el).rightclick({ force: true })
cy.contains("Save Block as PNG...").click()

View file

@ -8,7 +8,8 @@
import { inject } from './blockly_app.js'
import { imageExportRegistryItems } from '#src/image_exporter.js'
inject("blocklyDiv", {
// expose a handle for Cypress to get ahold of the blockly workspace
window.blocklyWorkspace = inject("blocklyDiv", {
contextMenu: {
register: [ ...imageExportRegistryItems ]
},