File tree 4 files changed +12
-9
lines changed
4 files changed +12
-9
lines changed Original file line number Diff line number Diff line change 14
14
# Python page object model (PyPOM)
15
15
> Represent most popular OOD pattern for Web UI automation using python programming language (for learning reference only).
16
16
>
17
- > Automated tests are demonstrated on http://newtours.demoaut .com/mercurywelcome.php web application.
17
+ > Automated tests are demonstrated on http://demo.guru99 .com/test/newtours web application.
18
18
19
19
## Tools
20
20
Original file line number Diff line number Diff line change @@ -10,6 +10,6 @@ class RegistrationPage(object):
10
10
user_name : str = "//input[@name='userName']"
11
11
password : str = "//input[@name='password']"
12
12
confirm_password : str = "//input[@name='confirmPassword']"
13
- submit : str = "//input[@name='register ']"
13
+ submit : str = "//input[@name='submit ']"
14
14
thank_you : str = "//*[contains(text(), 'Thank you for registering')]"
15
15
post_user : str = "//*[contains(text(), 'Your user name is')]"
Original file line number Diff line number Diff line change 1
1
from abc import ABC , abstractmethod
2
2
3
3
4
+ BASE_DEMO_URL = "http://demo.guru99.com/test/newtours"
5
+
6
+
4
7
class Url (ABC ):
5
8
"""Abstraction of a page url."""
6
9
@@ -23,7 +26,7 @@ class HomePageUrl(Url):
23
26
"""Represent home page url."""
24
27
25
28
def __init__ (self ) -> None :
26
- self ._url : Url = PageUrl ("http://newtours.demoaut.com/mercurywelcome .php" )
29
+ self ._url : Url = PageUrl (f" { BASE_DEMO_URL } /index .php" )
27
30
28
31
def get (self ) -> str :
29
32
return self ._url .get ()
@@ -33,7 +36,7 @@ class RegisterPageUrl(Url):
33
36
"""Represent register page url."""
34
37
35
38
def __init__ (self ) -> None :
36
- self ._url : Url = PageUrl ("http://newtours.demoaut.com/mercuryregister .php" )
39
+ self ._url : Url = PageUrl (f" { BASE_DEMO_URL } /register .php" )
37
40
38
41
def get (self ) -> str :
39
42
return self ._url .get ()
@@ -43,7 +46,7 @@ class SignOnPageUrl(Url):
43
46
"""Represent sign on page url."""
44
47
45
48
def __init__ (self ) -> None :
46
- self ._url : Url = PageUrl ("http://newtours.demoaut.com/mercurysignon .php" )
49
+ self ._url : Url = PageUrl (f" { BASE_DEMO_URL } /login .php" )
47
50
48
51
def get (self ) -> str :
49
52
return self ._url .get ()
Original file line number Diff line number Diff line change 1
1
from tests .coverage .markers import unit
2
- from demoauto .map .urls import Url
2
+ from demoauto .map .urls import Url , BASE_DEMO_URL
3
3
4
- _home : str = "http://newtours.demoaut.com/mercurywelcome .php"
5
- _register : str = "http://newtours.demoaut.com/mercuryregister .php"
6
- _sign_on : str = "http://newtours.demoaut.com/mercurysignon .php"
4
+ _home : str = f" { BASE_DEMO_URL } /index .php"
5
+ _register : str = f" { BASE_DEMO_URL } /register .php"
6
+ _sign_on : str = f" { BASE_DEMO_URL } /login .php"
7
7
8
8
9
9
@unit
You can’t perform that action at this time.
0 commit comments