如何使用javascript函数在cypress中关闭打开的打印窗口

时间:2019-10-24 22:25:10

标签: javascript cypress

在cypress中单击打印按钮期间,如何关闭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(); 
}

0 个答案:

没有答案