You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: learn-pr/azure-devops/run-functional-tests-azure-pipelines/includes/5-write-ui-tests.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,7 +65,7 @@ This diagram shows the `IWebDriver` interface and a few of the classes that impl
65
65
66
66
The diagram shows three of the methods that `IWebDriver` provides: `Navigate`, `FindElement`, and `Close`.
67
67
68
-
The three classes shown here, `ChromeDriver`, `FirefoxDriver`, and `EdgeDriver`, each implement `IWebDriver` and its methods. There are other classes, such as `SafariDriver`, that also implement `IWebDriver`. Each driver class can control the web browser that it represents.
68
+
The three classes shown here—`ChromeDriver`, `FirefoxDriver`, and `EdgeDriver`—each implement `IWebDriver` and its methods. There are other classes, such as `SafariDriver`, that also implement `IWebDriver`. Each driver class can control the web browser that it represents.
69
69
70
70
Andy adds a member variable named `driver` to the `HomePageTest` class, like this code:
**Andy:** Now, we're ready to define the test method. Based on the manual tests that we ran earlier, let's call this method `ClickLinkById_ShouldDisplayModalById`. It's a good practice to give test methods descriptive names that define precisely what the test accomplishes. Here, we want to click a link defined by its `id` attribute. Then we want to verify that the proper modal window appears, also by using its `id` attribute.
227
+
**Andy:** Now, we're ready to define the test method. Based on the manual tests that we ran earlier, let's call this method `ClickLinkById_ShouldDisplayModalById`. It's a good practice to give test methods descriptive names that define precisely what the test accomplishes. Here, we want to selecta link defined by its `id` attribute. Then we want to verify that the proper modal window appears, also by using its `id` attribute.
228
228
229
229
Andy adds starter code for the test method:
230
230
@@ -238,7 +238,7 @@ public void ClickLinkById_ShouldDisplayModalById(string linkId, string modalId)
238
238
239
239
**Amita:** I can handle this part. We want to:
240
240
241
-
1. Locate the link by its `id` attribute and then click the link.
241
+
1. Locate the link by its `id` attribute and select the link.
242
242
1. Locate the resulting modal.
243
243
1. Close the modal.
244
244
1. Verify that the modal was displayed successfully.
@@ -283,15 +283,15 @@ public void ClickLinkById_ShouldDisplayModalById(string linkId, string modalId)
283
283
}
284
284
```
285
285
286
-
**Amita:** The coding looks great so far. But how do we connect this test to the `id` attributes that we collected earlier?
286
+
**Amita:** The coding looks great so far, but how do we connect this test to the `id` attributes that we collected earlier?
287
287
288
288
**Andy:** Great question. We'll handle that next.
289
289
290
290
### Define test case data
291
291
292
292
**Andy:** In NUnit, you can provide data to your tests in a few ways. Here, we use the `TestCase` attribute. This attribute takes arguments that it later passes back to the test method when it runs. We can have multiple `TestCase` attributes that each test a different feature of our app. Each `TestCase` attribute produces a test case that's included in the report that appears at the end of a pipeline run.
293
293
294
-
Andy adds these `TestCase` attributes to the test method. These attributes describe the **Download game** button, one of the game screens, and the top player on the leaderboard. Each attribute specifies two `id` attributes: one for the link to click and one for the corresponding modal window.
294
+
Andy adds these `TestCase` attributes to the test method. These attributes describe the **Download game** button, one of the game screens, and the top player on the leaderboard. Each attribute specifies two `id` attributes: one for the link to selectand one for the corresponding modal window.
295
295
296
296
```cs
297
297
// Download game
@@ -306,7 +306,7 @@ public void ClickLinkById_ShouldDisplayModalById(string linkId, string modalId)
306
306
...
307
307
```
308
308
309
-
**Andy:** For each `TestCase` attribute, the first parameter is the `id` attribute forthe link to click on. The second parameter is the `id` attribute for the modal window that we expect to appear. You can see how these parameters correspond to the two-string argumentsin our test method.
309
+
**Andy:** For each `TestCase` attribute, the first parameter is the `id` attribute forthe link to select. The second parameter is the `id` attribute for the modal window that we expect to appear. You can see how these parameters correspond to the two-string argumentsin our test method.
310
310
311
311
**Amita:** I do see that. With some practice, I think I can add my own tests. When can we see these tests running in our pipeline?
Copy file name to clipboardExpand all lines: learn-pr/azure-devops/run-functional-tests-azure-pipelines/includes/6-run-ui-tests.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -89,11 +89,13 @@ To run the tests locally:
89
89
90
90
1. In Visual Studio Code, go to the integrated terminal and open a new terminal window.
91
91
1. Run the following commands in the new terminal window.
92
+
92
93
```dotnetcli
93
94
dotnet build --configuration Release
94
95
dotnet run --configuration Release --no-build --project Tailspin.SpaceGame.Web
95
96
```
96
-
1. Make a note of the local website link, in this example it is `http://localhost:5000`.
97
+
98
+
1. Make a note of the local website link; in this example, it's `http://localhost:5000`.
97
99
1. Switch back to the terminal window where you set the environment variables in the previous step, and ensure that you're in your project's root directory. Here's an example:
0 commit comments