You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25-3Lines changed: 25 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,8 @@ Selpy-Python is a Page Object Model (POM) framework for selenium automation with
4
4
5
5
This framework also uses [selpy](https://pypi.org/project/selpy/) custom built pypi module to implement snapshot feature (which is available in jest framework). If there are any change in UI we can directly change this in the test data file during the test run with ease. Manual maintenance of test data can be reduced drastically with this feature.
6
6
7
+
More details of this module can be refered in [selpy](https://pypi.org/project/selpy/) or [repo](https://github.com/nareshnavinash/selpy)
3. Ideally each web page should have a new file inside locators folder (with the same name as the web page) and all the locators inside a web page has to be declared inside a page class(Class name also should be same as the web page name).
134
+
4. To use the Locator method we need to pass the type of locator and the actual locator element. Type of locator has to be mentioned in the following way to allow `selpy` to process the locator.
135
+
```
136
+
CSS - 'css selector'
137
+
XPATH - 'xpath'
138
+
ID - 'id'
139
+
NAME - 'name'
140
+
LINK TEXT - 'link text'
141
+
PARTIAL LINK TEXT - 'partial link text'
142
+
TAG NAME - 'tag name'
143
+
CLASS NAME - 'class name'
144
+
```
145
+
146
+
5. Ideally each web page should have a new file inside locators folder (with the same name as the web page) and all the locators inside a web page has to be declared inside a page class(Class name also should be same as the web page name).
133
147
* If the web page name is `home page`then the locator file name should be `home_page.rb` inside `locators` folder and the class name should be `HomePageLocator` inside `Locators` module.
134
148
135
149
### Adding page methods to the project
@@ -154,7 +168,7 @@ class AmazonHomePage(AmazonHomePageLocator):
3. Ideally each web page should have a new page file inside `pages` folder with the class name same as the web page name.
171
+
4. Ideally each web page should have a new page file inside `pages` folder with the class name same as the web page name.
158
172
* If the web page name is `home page`then the pages file name should be `home_page.rb` inside `pages` folder and the class name should be `HomePage` inside `Pages` module.
159
173
160
174
### Creating a new test file in the project
@@ -194,7 +208,7 @@ Use `allure.step("step name")` to have a detailed reporting in allure.
194
208
195
209
3. Append the method name for the test as `test_` only then it will be taken as a test case. This has been configured in ```pytest.ini``` as,
196
210
197
-
```python
211
+
```ini
198
212
markers =
199
213
sanity: sanity tests marker
200
214
regression: regression tests marker
@@ -263,6 +277,14 @@ This ensures that this data has been set before pytest is being invoked only onc
263
277
assert (AmazonHomePage.is_home_page_displayed() is True), "Amazon home page is not displayed"
264
278
```
265
279
280
+
### Data sets:
281
+
282
+
In order to have distinguished set of data I have used three types of data.
283
+
284
+
**Global** - Global configuration for the whole project. Here mode of run, browsers to use, browser configurations etc., are specified.
285
+
**Test Data** - This is to store the module level data. Ideally for each test file we need to have a test data file, but that depends on the requirement.
286
+
**Dynamic Data** - This is to store the dynamic data. Files in this folder are supposed to change when we run with `snap=1 pytest`. This is separated from the other data files so that other static files are not disturbed during the run.
287
+
266
288
## Detailing snap Mode:
267
289
268
290
Snap mode is created to reduce the burden in maintaining the test data. While we test an application with data heavy validations, there is a high chance that the data in the application may change over the course of time.
0 commit comments