Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 6b87463

Browse files
authored
Overview spelling, punctuation fixes (#1156)
* Passed text through spellchecker to identify & fix mistakes I fixed the mistakes identified by the advanced spell-checker Grammarly. * Update details.en.md Passed through spell checker to fix errors and improve structure. * New headings, grammar/punctuation fixes Added new headings to very long text on page object models help. Fixed spelling, grammar, and punctuation errors. * Update fresh_browser_per_test.en.md Added a comma to the first senctence * Removed mistakenly duplicated paragraph
1 parent a7217da commit 6b87463

File tree

7 files changed

+50
-46
lines changed

7 files changed

+50
-46
lines changed

website_and_docs/content/documentation/overview/_index.en.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Selenium overview"
2+
title: "Selenium Overview"
33
linkTitle: "Overview"
44
weight: 2
55
description: >
@@ -15,10 +15,10 @@ but it composes many tools.
1515

1616
If you are beginning with desktop website or mobile website test automation, then you
1717
are going to be using WebDriver APIs. [WebDriver](/documentation/webdriver)
18-
uses browser automation APIs provided by browser vendors to control browser and
18+
uses browser automation APIs provided by browser vendors to control the browser and
1919
run tests. This is as if a real user is operating the browser. Since
2020
WebDriver does not require its API to be compiled with application
21-
code, it is not intrusive. Hence, you are testing the
21+
code; It is not intrusive. Hence, you are testing the
2222
same application which you push live.
2323

2424

@@ -41,6 +41,6 @@ when the test cases are triggered, they are automatically
4141
executed by the remote end.
4242

4343
After the development of the WebDriver tests, you may face
44-
the need of running your tests on multiple browser and
44+
the need to run your tests on multiple browsers and
4545
operating system combinations.
4646
This is where [Grid](/documentation/grid) comes into the picture.

website_and_docs/content/documentation/overview/components.en.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,41 +9,41 @@ aliases: [
99
---
1010

1111
Building a test suite using WebDriver will require you to understand and
12-
effectively use a number of different components. As with everything in
12+
effectively use several components. As with everything in
1313
software, different people use different terms for the same idea. Below is
1414
a breakdown of how terms are used in this description.
1515

1616
### Terminology
1717

1818
* **API:** Application Programming Interface. This is the set of "commands"
1919
you use to manipulate WebDriver.
20-
* **Library:** A code module which contains the APIs and the code necessary
20+
* **Library:** A code module that contains the APIs and the code necessary
2121
to implement them. Libraries are specific to each language binding, eg .jar
2222
files for Java, .dll files for .NET, etc.
2323
* **Driver:** Responsible for controlling the actual browser. Most drivers
2424
are created by the browser vendors themselves. Drivers are generally
2525
executable modules that run on the system with the browser itself,
26-
not on the system executing the test suite. (Although those may be the
26+
not the system executing the test suite. (Although those may be the
2727
same system.) NOTE: _Some people refer to the drivers as proxies._
28-
* **Framework:** An additional library used as a support for WebDriver
28+
* **Framework:** An additional library that is used as a support for WebDriver
2929
suites. These frameworks may be test frameworks such as JUnit or NUnit.
3030
They may also be frameworks supporting natural language features such
3131
as Cucumber or Robotium. Frameworks may also be written and used for
32-
things such as manipulating or configuring the system under test, data
32+
tasks such as manipulating or configuring the system under test, data
3333
creation, test oracles, etc.
3434

3535

3636
### The Parts and Pieces
3737
At its minimum, WebDriver talks to a browser through a driver. Communication
38-
is two way: WebDriver passes commands to the browser through the driver, and
38+
is two-way: WebDriver passes commands to the browser through the driver, and
3939
receives information back via the same route.
4040

4141
{{< figure src="/images/documentation/webdriver/basic_comms.png" class="img-responsive text-center" alt="Basic Communication">}}
4242

4343
The driver is specific to the browser, such as ChromeDriver for Google's
4444
Chrome/Chromium, GeckoDriver for Mozilla's Firefox, etc. The driver runs on
45-
the same system as the browser. This may, or may not be, the same system where
46-
the tests themselves are executing.
45+
the same system as the browser. This may or may not be the same system where
46+
the tests themselves are executed.
4747

4848
This simple example above is _direct_ communication. Communication to the
4949
browser may also be _remote_ communication through Selenium Server or
@@ -64,8 +64,8 @@ of the methods above. WebDriver does not know a thing about testing: it does not
6464
know how to compare things, assert pass or fail, and it certainly does not know
6565
a thing about reporting or Given/When/Then grammar.
6666

67-
This is where various frameworks come in to play. At a minimum you will need a
68-
test framework that matches the language bindings, e.g. NUnit for .NET, JUnit
67+
This is where various frameworks come into play. At a minimum, you will need a
68+
test framework that matches the language bindings, e.g., NUnit for .NET, JUnit
6969
for Java, RSpec for Ruby, etc.
7070

7171
The test framework is responsible for running and executing your WebDriver
@@ -76,4 +76,4 @@ to the following image.
7676

7777
Natural language frameworks/tools such as Cucumber may exist as part of that
7878
Test Framework box in the figure above, or they may wrap the Test Framework
79-
entirely in their own implementation.
79+
entirely in their custom implementation.

website_and_docs/content/documentation/overview/details.en.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,29 @@ that uses the best techniques available
1919
to remotely control browser instances
2020
and emulate a user's interaction with the browser.
2121

22-
It allows users to simulate common activities performed by end-users;
22+
Selenium allows users to simulate common activities performed by end-users;
2323
entering text into fields,
2424
selecting drop-down values and checking boxes,
2525
and clicking links in documents.
2626
It also provides many other controls such as mouse movement,
2727
arbitrary JavaScript execution, and much more.
2828

2929
Although used primarily for front-end testing of websites,
30-
Selenium is at its core a browser user agent _library_.
30+
Selenium is, at its core, a browser user agent _library_.
3131
The interfaces are ubiquitous to their application,
32-
which encourages composition with other libraries to suit your purpose.
32+
encouraging composition with other libraries to suit your purpose.
3333

3434

3535
### One interface to rule them all
3636

3737
One of the project's guiding principles
3838
is to support a common interface for all (major) browser technologies.
3939
Web browsers are incredibly complex, highly engineered applications,
40-
performing their operations in completely different ways
40+
performing their operations in entirely different ways
4141
but which frequently look the same while doing so.
4242
Even though the text is rendered in the same fonts,
4343
the images are displayed in the same place
44-
and the links take you to the same destination.
44+
, and the links take you to the same destination.
4545
What is happening underneath is as different as night and day.
4646
Selenium “abstracts” these differences,
4747
hiding their details and intricacies from the person writing the code.
@@ -84,9 +84,9 @@ As it has grown in popularity, so have its requirements and challenges multiplie
8484
As the web becomes more complicated
8585
and new technologies are added to websites,
8686
it's the mission of this project to keep up with them where possible.
87-
Being an open source project,
87+
Being an open-source project,
8888
this support is provided through the generous donation of time from many volunteers,
89-
every one of which has a “day job”.
89+
every one of which has a “day job.”
9090

9191
Another mission of the project is to encourage
9292
more volunteers to partake in this effort,

website_and_docs/content/documentation/test_practices/_index.en.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ description: >
88

99
A note on "Best Practices": We've intentionally avoided the phrase "Best
1010
Practices" in this documentation. No one approach works for all situations.
11-
We prefer the idea of "Guidelines and Recommendations". We encourage
11+
We prefer the idea of "Guidelines and Recommendations." We encourage
1212
you to read through these and thoughtfully decide what approaches
1313
will work for you in your particular environment.
1414

15-
Functional testing is difficult to get right for many reasons.
15+
Functional testing is challenging to get right for many reasons.
1616
As if application state, complexity, and dependencies do not make testing difficult enough,
1717
dealing with browsers (especially with cross-browser incompatibilities)
1818
makes writing good tests a challenge.
1919

2020
Selenium provides tools to make functional user interaction easier,
2121
but does not help you write well-architected test suites.
22-
In this chapter we offer advice, guidelines, and recommendations
22+
In this chapte, we offer advice, guidelines, and recommendations
2323
on how to approach functional web page automation.
2424

2525
This chapter records software design patterns popular

website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.en.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ aliases: [
99
---
1010

1111

12-
Although mentioned in several places it is worth mentioning again. Ensure
13-
tests are isolated from one another.
12+
Although mentioned in several places, it is worth mentioning again.
13+
We must ensure that the tests are isolated from one another.
1414

1515
* Do not share test data. Imagine several tests that each query the database
1616
for valid orders before picking one to perform an action on. Should two tests
17-
pick up the same order you are likely to get unexpected behaviour.
17+
pick up the same order you are likely to get unexpected behavior.
1818

1919
* Clean up stale data in the application that might be picked up by another
2020
test e.g. invalid order records.

website_and_docs/content/documentation/test_practices/encouraged/fresh_browser_per_test.en.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ aliases: [
88
]
99
---
1010

11-
Start each test from a clean known state.
11+
Start each test from a clean, known state.
1212
Ideally, spin up a new virtual machine for each test.
1313
If spinning up a new virtual machine is not practical,
1414
at least start a new WebDriver for each test.

website_and_docs/content/documentation/test_practices/encouraged/page_object_models.en.md

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,33 +13,33 @@ the [Selenium wiki](https://github.com/SeleniumHQ/selenium/wiki/PageObjects)
1313

1414
## Overview
1515

16-
Within your web app's UI there are areas that your tests interact with.
17-
A Page Object simply models these as objects within the test code.
16+
Within your web app's UI, there are areas where your tests interact with.
17+
A Page Object only models these as objects within the test code.
1818
This reduces the amount of duplicated code and means that if the UI changes,
19-
the fix need only be applied in one place.
19+
the fix needs only to be applied in one place.
2020

21-
Page Object is a Design Pattern which has become popular in test automation for
21+
Page Object is a Design Pattern that has become popular in test automation for
2222
enhancing test maintenance and reducing code duplication. A page object is an
2323
object-oriented class that serves as an interface to a page of your AUT. The
2424
tests then use the methods of this page object class whenever they need to
2525
interact with the UI of that page. The benefit is that if the UI changes for
2626
the page, the tests themselves don’t need to change, only the code within the
27-
page object needs to change. Subsequently all changes to support that new UI
27+
page object needs to change. Subsequently, all changes to support that new UI
2828
are located in one place.
2929

3030
### Advantages
3131

32-
* There is a clean separation between test code and page specific code such as
32+
* There is a clean separation between the test code and page-specific code, such as
3333
locators (or their use if you’re using a UI Map) and layout.
34-
* There is a single repository for the services or operations offered by the page
34+
* There is a single repository for the services or operations the page offers
3535
rather than having these services scattered throughout the tests.
3636

37-
In both cases this allows any modifications required due to UI changes to all
38-
be made in one place. Useful information on this technique can be found on
37+
In both cases, this allows any modifications required due to UI changes to all
38+
be made in one place. Helpful information on this technique can be found on
3939
numerous blogs as this ‘test design pattern’ is becoming widely used. We
40-
encourage the reader who wishes to know more to search the internet for blogs
40+
encourage readers who wish to know more to search the internet for blogs
4141
on this subject. Many have written on this design pattern and can provide
42-
useful tips beyond the scope of this user guide. To get you started, though,
42+
helpful tips beyond the scope of this user guide. To get you started,
4343
we’ll illustrate page objects with a simple example.
4444

4545
### Examples
@@ -178,6 +178,7 @@ There is a lot of flexibility in how the page objects may be designed, but
178178
there are a few basic rules for getting the desired maintainability of your
179179
test code.
180180

181+
## Assertions in Page Objects
181182
Page objects themselves should never make verifications or assertions. This is
182183
part of your test and should always be within the test’s code, never in an page
183184
object. The page object will contain the representation of the page, and the
@@ -191,6 +192,7 @@ instantiating the page object. In the examples above, both the SignInPage and
191192
HomePage constructors check that the expected page is available and ready for
192193
requests from the test.
193194

195+
## Page Component Objects
194196
A page object does not necessarily need to represent all the parts of a
195197
page itself. The same principles used for page objects can be used to
196198
create "Page _Component_ Objects" that represent discrete chunks of the
@@ -202,6 +204,7 @@ pages. If a page in the AUT has multiple components, or common
202204
components used throughout the site (e.g. a navigation bar), then it
203205
may improve maintainability and reduce code duplication.
204206

207+
## Other Design Patterns Used in Testing
205208
There are other design patterns that also may be used in testing. Some use a
206209
Page Factory for instantiating their page objects. Discussing all of these is
207210
beyond the scope of this user guide. Here, we merely want to introduce the
@@ -211,11 +214,12 @@ reader to search for blogs on these topics.
211214

212215
## Implementation Notes
213216

214-
PageObjects can be thought of as facing in two directions simultaneously. Facing towards the developer of a test, they represent the **services** offered by a particular page. Facing away from the developer, they should be the only thing that has a deep knowledge of the structure of the HTML of a page (or part of a page) It's simplest to think of the methods on a Page Object as offering the "services" that a page offers rather than exposing the details and mechanics of the page. As an example, think of the inbox of any web-based email system. Amongst the services that it offers are typically the ability to compose a new email, to choose to read a single email, and to list the subject lines of the emails in the inbox. How these are implemented shouldn't matter to the test.
215217

216-
Because we're encouraging the developer of a test to try and think about the services that they're interacting with rather than the implementation, PageObjects should seldom expose the underlying WebDriver instance. To facilitate this, methods on the PageObject should return other PageObjects. This means that we can effectively model the user's journey through our application. It also means that should the way that pages relate to one another change (like when the login page asks the user to change their password the first time they log into a service, when it previously didn't do that) simply changing the appropriate method's signature will cause the tests to fail to compile. Put another way, we can tell which tests would fail without needing to run them when we change the relationship between pages and reflect this in the PageObjects.
218+
PageObjects can be thought of as facing in two directions simultaneously. Facing toward the developer of a test, they represent the **services** offered by a particular page. Facing away from the developer, they should be the only thing that has a deep knowledge of the structure of the HTML of a page (or part of a page) It's simplest to think of the methods on a Page Object as offering the "services" that a page offers rather than exposing the details and mechanics of the page. As an example, think of the inbox of any web-based email system. Amongst the services it offers are the ability to compose a new email, choose to read a single email, and list the subject lines of the emails in the inbox. How these are implemented shouldn't matter to the test.
217219

218-
One consequence of this approach is that it may be necessary to model (for example) both a successful and unsuccessful login, or a click could have a different result depending on the state of the app. When this happens, it is common to have multiple methods on the PageObject:
220+
Because we're encouraging the developer of a test to try and think about the services they're interacting with rather than the implementation, PageObjects should seldom expose the underlying WebDriver instance. To facilitate this, methods on the PageObject should return other PageObjects. This means we can effectively model the user's journey through our application. It also means that should the way that pages relate to one another change (like when the login page asks the user to change their password the first time they log into a service when it previously didn't do that), simply changing the appropriate method's signature will cause the tests to fail to compile. Put another way; we can tell which tests would fail without needing to run them when we change the relationship between pages and reflect this in the PageObjects.
221+
222+
One consequence of this approach is that it may be necessary to model (for example) both a successful and unsuccessful login; or a click could have a different result depending on the app's state. When this happens, it is common to have multiple methods on the PageObject:
219223

220224
```
221225
public class LoginPage {
@@ -253,9 +257,9 @@ public void testMessagesAreReadOrUnread() {
253257
}
254258
```
255259

256-
Of course, as with every guideline there are exceptions, and one that is commonly seen with PageObjects is to check that the WebDriver is on the correct page when we instantiate the PageObject. This is done in the example below.
260+
Of course, as with every guideline, there are exceptions, and one that is commonly seen with PageObjects is to check that the WebDriver is on the correct page when we instantiate the PageObject. This is done in the example below.
257261

258-
Finally, a PageObject need not represent an entire page. It may represent a section that appears many times within a site or page, such as site navigation. The essential principle is that there is only one place in your test suite with knowledge of the structure of the HTML of a particular (part of a) page.
262+
Finally, a PageObject need not represent an entire page. It may represent a section that appears frequently within a site or page, such as site navigation. The essential principle is that there is only one place in your test suite with knowledge of the structure of the HTML of a particular (part of a) page.
259263

260264
## Summary
261265

@@ -343,4 +347,4 @@ public class LoginPage {
343347

344348
## Support in WebDriver
345349

346-
There is a PageFactory in the support package that provides support for this pattern, and helps to remove some boiler-plate code from your Page Objects at the same time.
350+
There is a PageFactory in the support package that provides support for this pattern and helps to remove some boiler-plate code from your Page Objects at the same time.

0 commit comments

Comments
 (0)