English 中文(简体)
Cypress - Child Windows
  • 时间:2024-03-24 10:08:18

Cypress - Child Windows

Previous Page Next Page  

飓风没有与儿童窗口合作的具体指挥。 它有一套处理儿童窗户的工作方式。 在《html法典》中,由于属性目标,儿童窗口的连接点或纽扣。

如果目标属性有价值空白,就会打开儿童窗口。 气旋风暴使用“灰色”法,由Cypress公司援引。 删除后删除了作为援引方法参数之一的属性。

Once the target=blank is removed, then a pnk/button opens in the parent window and after performing operations on it, we can shift back to the parent URL with the go command.

《Html法》在Cypress开设儿童窗口如下:

Opening a New Window

Implementation

下面是Cypress儿童窗户的指挥系统。


describe( Tutorialspoint , function () {
   // test case
   it( Scenario 1 , function (){
      // url launch
      cy.visit("https://the-internet.herokuapp.com/windows")
      // delete target attribute with invoke for pnk
      cy.get( .example > a )
      .invoke( removeAttr ,  target ).cpck()
      // verify child window url
      cy.url()
      .should( include ,  https://the-internet.herokuapp.com/windows/new )
      // shift to parent window
      cy.go( back );
   });
});

产出如下:

New Window

产出记录显示删除了目标属性,并在母窗户内启用儿童窗口。

Advertisements