Skip to content

Commit

Permalink
edit according to review
Browse files Browse the repository at this point in the history
  • Loading branch information
rina-tenitska committed Jul 31, 2024
1 parent 1c62ba6 commit dc07f09
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
6 changes: 2 additions & 4 deletions docs/selene-for-page-objects-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -453,9 +453,7 @@ class Google:
query = browser.element(by.name('q'))
results = browser.all('#rso>div')
first_result_header = results.first.element('h3')

def __init__(self):
self.__submit_button = browser.all(by.name('btnK')).first
submit_button = browser.all(by.name('btnK')).first

def result(self, number):
return self.results[number - 1]
Expand All @@ -475,6 +473,6 @@ google = Google()

And here it is important that in most cases such premature encapsulation contradicts KISS. Why do we really need to hide something here? :) From whom? :) On some project, if some manual testers write these tests, and we want to allow them to use only step functions – then yes, it could be... But if not, why this premature optimization? (which is the root of all evil). Why not simplify your life and embed everything in one object returned from a function (or class).

For the possibility of refactoring elements and actions on them, or more precisely – for the ability to use all the power and variability of Python without restrictions from the automation tool of user steps in the browser – just corresponds to the peculiarity of Selene elements to be “lazy”, that is, “not to be found immediately at the moment of their definition”, which equates them to locators of the type `By.NAME('q')`.
For the possibility of refactoring elements and actions on them, or more precisely – for the ability to use all the power and variability of Python without restrictions from the automation tool of user steps in the browser – just corresponds to the peculiarity of Selene elements to be “lazy”, that is, “not to be found immediately at the moment of their definition”, which equates them to locators of the type `(By.NAME,'q')`.

Amen ;)
8 changes: 4 additions & 4 deletions docs/selene-quick-start-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## What and where?

Selene in Pythonis a tool for automating user actions in the browser, oriented towards the convenience and ease of implementing business logic in automated tests, in the language of the user, without distracting from the technical details of working with the “browser driver”. For example, technical details can include working with element waits when automating testing of dynamic web applications, implementing high-level actions over elements, complex locators based on low-level selectors, and so on.
Selene in Python is a tool for automating user actions in the browser, oriented towards the convenience and ease of implementing business logic in automated tests, in the language of the user, without distracting from the technical details of working with the “browser driver”. For example, technical details can include working with element waits when automating testing of dynamic web applications, implementing high-level actions over elements, complex locators based on low-level selectors, and so on.

Under the hood it uses Selenium WebDriver as the main tool for interacting with the browser. Therefore, it is also called more high-level “wrapper” around more low-level tools such as Selenium WebDriver

Expand All @@ -21,7 +21,7 @@ So, owning [basic skills in programming](https://autotest.how/start-programming.

* [Git](https://git-scm.com/)
* [Chrome Browser](https://www.google.com/chrome/)
* [ChromeDriver](https://sites.google.com/a/chromium.org/chromedriver/getting-started)<ru>не обязательно, мы установим его из кода далее</ru><uk>не обов'язково, ми встановимо його з коду далі</uk><en>not required, we will install it from the code later</en>
* [ChromeDriver](https://sites.google.com/a/chromium.org/chromedriver/getting-started) – not required, it will be installed from the code automatically


## Initialize project
Expand Down Expand Up @@ -459,9 +459,9 @@ def test_finds_selene():

```

There is a brief description of the main Selene's API. Be sure to read this before using Selene in a real project.
There is a brief description of the main [Selene's API](./selene-cheetsheet-howto.md). Be sure to read this before using Selene in a real project.

And support can be obtained in the official [telegram chat](https://selene_py_ru.t.me), in which there is a [large FAQ in the pinned message](https://t.me/selene_py_ru/475).
And support can be obtained in the official [telegram chat](https://t.me/selene_py).

More detailed practical application of basic commands is explained in the [“Selene in Action”](./selene-in-action-tutorial.md) tutorial.

Expand Down

0 comments on commit dc07f09

Please sign in to comment.