-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added locators strategy added test_input.py
- Loading branch information
dmy.berezovskyi
committed
Oct 15, 2024
1 parent
ecc271a
commit 9874e25
Showing
5 changed files
with
62 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class InputLocators: | ||
FULL_NAME_SELECTOR: str = 'input[id="userName"]' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from playwright.sync_api import Page | ||
|
||
from base_page import BasePage | ||
from locators.input_locators import InputLocators | ||
from utils.logger import log | ||
|
||
|
||
class InputForm(BasePage): | ||
def __init__(self, page: Page): | ||
super().__init__(page) | ||
self.locators = InputLocators() | ||
|
||
def fill_full_name(self, name: str): | ||
"""Fill user full name""" | ||
self.fill(self.locators.FULL_NAME_SELECTOR, name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from pages.input_form import InputForm | ||
|
||
|
||
class TestFillForm: | ||
|
||
def test_fill_full_name(self, page): | ||
"""Test filling in the full name in the input form.""" | ||
input_form = InputForm(page) | ||
|
||
# Navigate to the input form page | ||
input_form.navigate_to( | ||
"https://demoqa.com/text-box") | ||
|
||
# Fill in the full name | ||
input_form.fill_full_name("John Doe") |