English 中文(简体)
Cypress - Basic Commands
  • 时间:2024-03-24 11:17:35

Cypress - Basic Commands

Previous Page Next Page  

气压基本指挥系统如下:

and

它被用来制造一种说法,并且是(......)应当做到的内容。

使用情况如下:


//element is visible & enabled
cy.get( #txt ).should( be.visible ).and( be.enabled )
//element is checked
cy.contains( Subject ).and( be.checked )

as

它规定了以后使用的内容。

使用情况如下:


//apas element as parent
cy.get( #txt ).find( p ).first().as( parent )

blur

它混淆了重点内容。

使用情况如下:


//blur input
cy.get( #txt ). type( abc ).blur()

check

它检查了无线电塔顿或检查箱,并适用于有投入标记的部件。

使用情况如下:


//checks element having class attribute chkbox
cy.get( .chkbox ).check()

children

它获得一个要素的子要素。

使用情况如下:


//obtains children of element n
cy.get( n ).children()

clear

它从文字或投入中删除了价值。

使用情况如下:


//removes input abc
cy.get( #txt ). type( abc ).clear()

clearCookie

它排除了一种特殊的浏览器 co。

使用情况如下:


//clear abc cookie
cy.clearCookie( abc )

clearCookies

它从现有的领域和次域中排除了浏览器 co。

使用情况如下:


//clear all cookies
cy.clearCookies()

clearLocalStorage

它将当地储存数据从现有域和次域中删除。

使用情况如下:


//clear all local storage
cy. clearLocalStorage ()

cpck

它点击了文件目标模型中的一个要素。

使用情况如下:


//cpck on element with id txt
cy.get( #txt ).cpck()

contains

It obtains an element having a specific text. The element can have more than the text and still match.

使用情况如下:


//returns element in #txt having Tutor text
cy.get( #txt ).contains( Tutor )

dblcpck

文件目标模型(DOM)的一个要素是重复计算。

使用情况如下:


//double cpcks element with id txt
cy.get( #txt ).dblcpck()

debug

它固定了一个夸张的标志,并按先前的指挥归还了原木价值。

使用情况如下:


//pause to debug at start of command
cy.get( #txt ).debug()

document

它获得窗户。 积极网页上的文件。

使用情况如下:


cy.document()

each

它通过一系列具有财产长度的阵列进行修复。

使用情况如下:


//iterate through inspanidual p
cy.get( p ).each(() => {...})

end

它结束了指挥链。

使用情况如下:


//obtain null instead of input
cy.contains( input ).end()

eq

它指的是一系列要素中某一指数的一个要素。

使用情况如下:


//obtain third td in tr
cy.get( tr>td ).eq(2)

exec

它指挥系统。

使用情况如下:


cy.exec( npm init )

find

它获得某个特定地点后裔。

使用情况如下:


//obtain td from tr
cy.get( tr ).find( td )

first

它从一组要素中获得第一个要素。

使用情况如下:


//obtain first td in tr
cy.get( tr>td ).first()

get

它通过定位器获取单一或多个元素。

使用情况如下:


//obtain td from tr

find

它获得某个特定地点后裔。

使用情况如下:


//obtain all td from tr in pst
cy.get( tr>td )

getCookie

它通过名称获得一个特定的浏览器 co。

使用情况如下:


cy.getCookie( abc )

getCookies

它获得所有厨师。

使用情况如下:


cy.getCookies()

go

它向前发展,或向下届或以前在浏览过程中的URL迈进。

使用情况如下:


//pke cpcking back button
cy.go( back )
//pke cpcking forward button
cy.go( forward )

visit

罗马尼亚

使用情况如下:


cy.visit( https://www.tutorialspoint.com/index.htm )

next

It obtains the immediate sibpng of an element within a group of elements in Document Object Model (DOM).

使用情况如下:


//gives the following pnk in element l.
cy.get( l a:first ).next()

parent

它从人力部的一组要素获得母子成分。

使用情况如下:


//get parent of element with class h
cy.get( .h ).parent()

should

它被用于制造一种说法,是(......)和(b)项的内容。

使用情况如下:


//assert element is visible & enabled
cy.get( #txt ).should( be.visible ).and( be.enabled )

wait

一段时间内,在移动以下步骤之前,在摩擦中,或在别的元件中 Wa。

使用情况如下:


cy.wait(1000)

title

它获得该文件。 页: 1

使用情况如下:


cy.title()

viewport

它管理屏幕的尺寸和定位。

使用情况如下:


// viewport to 100px and 500px
cy.viewport(100, 500)

log

它向陆军司令部印刷了电文。

使用情况如下:


cy.log( Cypress logging  )

reload

用于上页。

使用情况如下:


cy.reload()
Advertisements