|
3 | 3 |
|
4 | 4 | class MyTestClass(BaseCase):
|
5 | 5 | def test_example_1(self):
|
6 |
| - url = "https://store.xkcd.com/collections/posters" |
7 |
| - self.open(url) |
8 |
| - self.type("input.search-input", "xkcd book\n") |
9 |
| - self.assert_text("xkcd: volume 0", "h3") |
10 |
| - self.click("li.checkout-link a") |
11 |
| - self.assert_text("Shopping Cart", "#page-title") |
12 |
| - self.assert_element("div#umbrella") |
13 |
| - self.open("https://xkcd.com/353/") |
14 |
| - self.assert_title("xkcd: Python") |
15 |
| - self.assert_element('img[alt="Python"]') |
16 |
| - self.click('a[rel="license"]') |
17 |
| - self.assert_text("back to this page") |
18 |
| - self.go_back() |
19 |
| - self.click_link("About") |
20 |
| - self.assert_exact_text("xkcd.com", "h2") |
| 6 | + self.open("https://www.saucedemo.com") |
| 7 | + self.type("#user-name", "standard_user") |
| 8 | + self.type("#password", "secret_sauce\n") |
| 9 | + self.assert_element("#inventory_container") |
| 10 | + self.assert_exact_text("PRODUCTS", "span.title") |
| 11 | + self.click('button[name*="backpack"]') |
| 12 | + self.click("#shopping_cart_container a") |
| 13 | + self.assert_exact_text("YOUR CART", "span.title") |
| 14 | + self.assert_text("Backpack", "div.cart_item") |
| 15 | + self.click('button:contains("Remove")') # HTML innerText |
| 16 | + self.assert_text_not_visible("Backpack", "div.cart_item") |
| 17 | + self.js_click("a#logout_sidebar_link") |
0 commit comments