https://cypress.io logo
Not Go.Js, but something similar, I did something ...
# best-practices
g
Not Go.Js, but something similar, I did something like this: // @ts-ignore if (window.Cypress) { // @ts-ignore window.store = store; } In test code, we can then use developer tools and cy.window() to select canvas objects: Cypress.Commands.add('clickComputer', (comp, name, beac) => { return cy.window().then(window => { const computer = window.store.campaign.allItems.filter(beacon => beacon.__typename === 'Computer'); computer[comp].select(); hostName = window.store.campaign.selectedHost.hostName; console.log(hostName); expect(hostName).to.eql(name); const numBeacons = window.store.campaign.selectedHost.beaconIds.data_.size; console.log(numBeacons); expect(numBeacons).to.eq(beac); }); }); @gray-kilobyte-89541 probably has a better way, but this is what I did.