Discuz! Board

 找回密碼
 立即註冊
搜索
熱搜: 活動 交友 discuz
查看: 2|回復: 0
打印 上一主題 下一主題

[正在审核] Fixtures Recall the example test

[複製鏈接]

1

主題

1

帖子

0

積分

1级

Rank: 1

積分
0
跳轉到指定樓層
樓主
發表於 2023-12-26 19:17:00 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
Named Copy Create a new file in that folder named Copy Here you will define the class that describes the login page. Import provided types at the very top of the file Copy This helper type describes a fixture that can be used for all tests registered in named. This object represents a single tab in the browser. The class you are writing will need this object in its constructor so that it can interact with the browser page. Add and export a class named The constructor of this class accepts a parameter of type Copy By accessing a browser page you can now define reusable interactions specific to this page. Begin by adding a member function named Copy that is used to navigate to the application's pages. For information about the available functionality of this object, review the documentation. Next add a second function to fill out the login form Copy For this tutorial these are the only reusable set of instructions needed for the login page. Next you'll use fixtures to expose an instance of this class to each test.shown above where an object is deconstructed from the parameters of the function's callback function.

This is the same fixture provided as refer photo editing servies enced in the previous section. Comes with one that allows you to extend existing functionality to provide custom installations. In this section you will write a fixture that allows you to provide a class for each test. The login page fixture starts from the root of Create a new folder in the named Copy and then in that new folder create a file named Copy at the very top of the file using the name Import the function Copy from The variables imported here are You will use the default function of the custom fixture extension. However before extending this function you need definitions to describe the fixtures you will add. Add the following to describe a fixture named Copy. This fixture provides an instance of the class for your tests. You can now extend the type of the function using Copy. In the object parameter.



Of the function you will now find that there is a Description property. Login Page IntelliSense You will define a new custom device in this property. The value will be an asynchronous function object with two arguments containing all available means of the function. A function that takes the desired instance as its only argument. This function provides an instance of the class for all tests. Test success Invalid login attempt Next use the function of the class Fill in the login form using a set of invalid login credentials Copy Finally use the function of the object Click the login button Wait for the request to complete and verify if the popup appears Copy Run the end-to-end test You should now Show another set of successful tests Copy the test twice Verify that the user receives a warning when trying to submit an empty form This test is very similar to the previous test It will start from the login page and submit the login form. The only difference is that the form should be empty and the error message .


回復

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 立即註冊

本版積分規則

Archiver|手機版|自動贊助|sk秀庄  

GMT+8, 2025-4-20 07:14 , Processed in 0.073577 second(s), 21 queries .

抗攻擊 by GameHost X3.1

© 2001-2013 Comsenz Inc.

快速回復 返回頂部 返回列表
一粒米 | 中興米 | 論壇美工 | 設計 抗ddos | 天堂私服 | ddos | ddos | 防ddos | 防禦ddos | 防ddos主機 | 天堂美工 | 設計 防ddos主機 | 抗ddos主機 | 抗ddos | 抗ddos主機 | 抗攻擊論壇 | 天堂自動贊助 | 免費論壇 | 天堂私服 | 天堂123 | 台南清潔 | 天堂 | 天堂私服 | 免費論壇申請 | 抗ddos | 虛擬主機 | 實體主機 | vps | 網域註冊 | 抗攻擊遊戲主機 | ddos |