Skip to content

Commit a46c765

Browse files
authored
Merge pull request #55 from jetbrains-academy/stephen-hero-patch-48
Update task.md
2 parents ea86265 + b0f5754 commit a46c765

File tree

1 file changed

+13
-13
lines changed
  • page_object/first_tests_with_po/base_page

1 file changed

+13
-13
lines changed
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
<p><strong>Важно! </strong>В этом уроке мы напишем самостоятельно простую реализацию паттерна Page Object.
2-
А в следующих уроках уже рассмотрим существующие фреймворки и то,
3-
как они могут облегчить нам жизнь. Сейчас самая главная задача &mdash;
4-
осознать принципы работы.&nbsp;</p>
1+
<p><strong>Important! </strong>In this lesson, we will write a simple implementation of the Page Object pattern.
2+
In the following lessons, we will explore existing frameworks and the ways
3+
they can make our lives easier. Right now, the most crucial task
4+
is to understand the principles of their work.&nbsp;</p>
55

66

7-
<p>Для начала сделаем базовую страницу, от которой будут унаследованы все остальные классы.
8-
В ней мы опишем&nbsp;вспомогательные методы для работы с вебдрайвером.</p>
7+
<p>To start, let's create a base page from which all other classes will be inherited.
8+
In it, we will describe auxiliary methods for working with the web driver.</p>
99

10-
<p>1. В файле <code>base_page.py</code> создайте класс с названием <code>BasePage</code>.&nbsp;</p>
10+
<p>1. In the <code>base_page.py</code> file, create a class named <code>BasePage</code>.&nbsp;</p>
1111

12-
<p>В Python такие вещи делаются с помощью следующей конструкции:&nbsp;</p>
12+
<p>In Python, such things are done using the following construct:&nbsp;</p>
1313

1414
<pre>
1515
<code>class BasePage:</code></pre>
1616

17-
<p>2. Теперь в наш класс нужно добавить методы.
18-
Первым делом добавим <em>конструктор &mdash;&nbsp;</em>метод, который вызывается, когда мы создаем объект. Конструктор объявляется ключевым словом <code>__init__</code>. В него в качестве параметров мы передаем экземпляр драйвера и url адрес. Внутри конструктора сохраняем эти данные как аттрибуты нашего класса. Получается примерно так:&nbsp;</p>
17+
<p>2. Now we need to add methods to our class.
18+
First of all, let's add a <em>constructor &mdash;&nbsp;</em>a method that is called when we create an object. A constructor is declared with the keyword <code>__init__</code>. As parameters, we pass an instance of the driver and the URL address. Inside the constructor, we save this data as attributes of our class. It looks like this:&nbsp;</p>
1919

2020
<pre>
2121
<code class="language-python">def __init__(self, browser, url):
2222
self.browser = browser
2323
self.url = url</code></pre>
2424

25-
<p>3. Теперь добавим еще один&nbsp;метод open. Он должен открывать нужную страницу в браузере, используя метод get().</p>
25+
<p>3. Now let's add another method, open. It should open the required page in the browser using the get() method.</p>
2626

27-
<p>Объявите ниже в том же классе:</p>
27+
<p>Declare the following in the same class:</p>
2828

2929
<pre>
3030
<code class="language-python">def open(self):</code></pre>
3131

32-
<p>и реализуйте этот метод: нужна всего одна строка.
32+
<p>And implement this method: it only needs one line.
3333
&nbsp;</p>

0 commit comments

Comments
 (0)