Skip to content

Commit f71fde3

Browse files
committed
Add placeholders and fix test
1 parent 186ef12 commit f71fde3

File tree

4 files changed

+29
-15
lines changed

4 files changed

+29
-15
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<h1> The heading will be blue because the color is set in the style attribute </h1>
1+
<h1 style="color: blue;"> The heading will be blue because the color is set in the style attribute </h1>
22

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

5-
<button> The button with the attribute disabled will be blocked</button>
5+
<button disabled> The button with the attribute disabled will be blocked</button>
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,25 @@
11
type: edu
22
files:
3-
- name: task.py
4-
visible: false
5-
- name: tests/test_task.py
6-
visible: false
7-
- name: __init__.py
8-
visible: false
9-
- name: tests/__init__.py
10-
visible: false
11-
- name: index.html
12-
visible: true
3+
- name: index.html
4+
visible: true
5+
placeholders:
6+
- offset: 3
7+
length: 21
8+
placeholder_text: ""
9+
is_visible: false
10+
- offset: 108
11+
length: 7
12+
placeholder_text: ""
13+
is_visible: false
14+
- offset: 204
15+
length: 9
16+
placeholder_text: ""
17+
is_visible: false
18+
- name: task.py
19+
visible: false
20+
- name: tests/test_task.py
21+
visible: false
22+
- name: __init__.py
23+
visible: false
24+
- name: tests/__init__.py
25+
visible: false

introduction/page_structure/visual attributes/task.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ may be necessary for element locating in tests.
77

88
Here are examples of attributes that affect rendering and the element's behavior:
99

10-
```
10+
```html
1111
<h1 style="color: blue;"> The heading will be blue because the color is set in the style attribute </h1>
1212

1313
<p hidden> The attribute hidden hides the element on a page; the element won't be displayed </p>
1414

1515
<button disabled> The button with the attribute disabled will be blocked </button>
1616
```
1717

18+
### Task
1819
Try opening `index.html` in your browser. Now add the visual attributes and try opening this file again.

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def test_add(self):
1313
try:
1414
self.assertTrue(soup.h1["style"] == "color: blue;", f"Should be color: blue style, got {soup.h1['style']}")
1515
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")
16+
self.assertTrue("disabled" in str(soup.button).split('>')[0], f"Should be disabled button")
1717

1818
except Exception as e:
1919
self.fail("wrong page structure")

0 commit comments

Comments
 (0)