如何关闭 print window 在单击cypress中的打印按钮时打开。我打电话给 js 关闭窗口的功能和它不执行关闭操作,请有人建议如何解决问题?
print window
js
context('Print button tests', () => { it.only('Verify the display of Print and close the window', () => { cy.get('.timetable-filter-panel-button.btn.btn-primary > span') .contains("Print current view") .click(); printClose(); }) })
//关闭打开窗口的Javascript函数:
function printClose(){ window.close(); }