Skip to content

Commit 10ef599

Browse files
committed
fixes
1 parent bb30715 commit 10ef599

File tree

7 files changed

+28
-7
lines changed

7 files changed

+28
-7
lines changed

introduction/finding_elements/find_child_element/tests/test_task.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ def test_add(self):
1515
browser.get("http://suninjuly.github.io/cats.html")
1616
element = browser.find_element(By.CSS_SELECTOR, child_selector)
1717
print(element.get_attribute("src"))
18-
self.assertTrue(element.get_attribute("src") == "http://suninjuly.github.io/images/serious_cat.jpg")
18+
self.assertTrue("serious_cat.jpg" in element.get_attribute("src"))
1919
finally:
2020
browser.quit()

introduction/introduction/prerequisites/task.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ You will need knowledge of
77
- syntax and basic features of Python.
88
- basic object-oriented programming (OOP) concepts for the fourth section of the course
99

10-
Please note libraries this course uses in requirements.txt.
11-
You can install them in your virtual environment bu executing
10+
Please note libraries this course uses in requirements.txt.
11+
You can install them in your virtual environment by executing
1212
`pip install -r requirements.txt`
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<h1 style="color: blue;"> The heading will be blue because the color is set in the style attribute </h1>
1+
<h1> The heading will be blue because the color is set in the style attribute </h1>
22

3-
<p hidden> The attribute hides the element on a page; the element won't be displayed </p>
3+
<p> The attribute hides the element on a page; the element won't be displayed </p>
44

5-
<button disabled> The button with the attribute disabled will be blocked </button>
5+
<button> The button with the attribute disabled will be blocked</button>

introduction/page_structure/visual attributes/task-info.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
type: edu
22
files:
33
- name: task.py
4-
visible: true
4+
visible: false
55
- name: tests/test_task.py
66
visible: false
77
- name: __init__.py

introduction/page_structure/visual attributes/task.md

+2
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ Here are examples of attributes that affect rendering and the element's behavior
1414
1515
<button disabled> The button with the attribute disabled will be blocked </button>
1616
```
17+
18+
Try opening `index.html` in your browser. Now add the visual attributes and try opening this file again.

introduction/page_structure/visual attributes/tests/__init__.py

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import unittest
2+
3+
from bs4 import BeautifulSoup
4+
5+
6+
class TestCase(unittest.TestCase):
7+
def test_add(self):
8+
HTMLFile = open("index.html", "r")
9+
index = HTMLFile.read()
10+
HTMLFile.close()
11+
soup = BeautifulSoup(index, "html5lib")
12+
image = soup.img
13+
try:
14+
self.assertTrue(soup.h1["style"] == "color: blue;", f"Should be color: blue style, got {soup.h1['style']}")
15+
self.assertTrue("hidden" in str(soup.p), f"Should be hidden paragraph")
16+
self.assertTrue("disabled" in str(soup.button), f"Should be disabled button")
17+
18+
except Exception as e:
19+
self.fail("wrong page structure")

0 commit comments

Comments
 (0)