-
Notifications
You must be signed in to change notification settings - Fork 675
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[docs] GS added #534
[docs] GS added #534
Conversation
|
||
This guide will provide you with step-by-step instructions on how to create a functional web test with TestCafe. | ||
You will learn how to install TestCafe, write a test, run the test on multiple browsers and view test results. | ||
During creating a test, you will learn the basics of TestCafe API, advancing step by step, from the simple to more elaborate testing techniques. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need this? Is there someone who don't know what "Getting started" is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a standard intro for GS, that quickly describes what the topic covers.
Also, we shouldn't repeat ourselves: there are various places there we start to describe functionality like "there are many reporters, you can create plugins, etc.". The better way is split getting started into following sections:
At the end of each section we can have reference to the appropriate articles, e.g. at the end of "Running tests and getting results" we can have links "Learn more about reporters", "Learn more about running configurations", etc. |
\r- |
FPR |
\cc @DevExpress/testcafe-docs I'll take a look a little bit later. Can someone else review for now? |
@MargaritaLoseva Tests are failed. It seems some links are broken |
@AlexanderMoskovkin Yes, I saw the broken links. They don't work because test api topics are not complete yet. Review only the text, please. |
const actualText = Hybrid(() => document.querySelector('#article-header').text); | ||
|
||
expect(await actualText.to.equal('Thank You, John Smith!'); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
});
### Observing Page State | ||
|
||
TestCafe allows you to observe the page state. | ||
For this purpose, it offers special functions: [Selector](../test-api/executing-client-code/index.md#selector-functions) to get direct access to DOM elements and [Client](test-api/executing-client-code/index.md#client-functions) to obtain arbitrary data from the client side. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's ClientFunction
, not Client
. Also
it offers special functions
I think it's better to say special kinds of functions
, because we don't offer the functions themselves, but the way to construct them.
\r- |
test('Test1', async t => { | ||
// Test code | ||
}); | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's always a little bit weird when we describe several steps of writing code in words with no examples in the middle.
There are two better ways:
- show the code growing step-by-step,
- first show the code and then describe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a third option: describe code structure using comments in code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have used the first way - growing step-by-step
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this particular example I don't think that growing step-by-step is a good approach. It's quite minimal and describes code organzation for tests, so it preferable to be observed all at once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think any other way will look better and more clear than step-by-step
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can I have a look at step-by-step version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also like the current variant (with growing step-by-step).
I don't want to use comments to describe this code, because comments will litter the test's clear structure.
Also, it's not good idea to describe all the test elements below the code - too much info at once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Step-by-step version is already commited
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, got it. Let's keep it as is.
\r- |
fixture `Getting Started` | ||
``` | ||
|
||
You can optionally specify a start page URL for the fixture by using the [page](../test-api/test-code-structure.md#specifying-the-start-webpage) function. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like specifying the start page is optional in this tutorial. But that's not true.
I'd better place a direct instruction here.
\r- |
lgtm |
|
||
// Declare the parameterized hybrid function | ||
// to obtain text content of an element identified by the `id` attribute | ||
const getElementById = Selector((id) => document.querySelector(`#${id}`)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to remove parenths around id
here as well
lgtm |
\cc @DevExpress/testcafe-docs |
We show how to run a test from the command line. Should we say in Getting started that it is possible to use |
No, this is advanced topic and more likely will be needed only for embedders. |
lgtm |
@kirovboris, @churkin please review |
lgtm |
1 similar comment
lgtm |
@testcafe-build-bot \retest |
@MargaritaLoseva are failed tests ok for now? |
Tests still fail due to broken links as @VasilyStrelyaev doesn't pull topics about API yet. |
closes #283
\cc @inikulin, @VasilyStrelyaev
Please, review only the text (Since test API is not complete, code snippets may not work properly and an image is not added yet. Links to API sections don't work as well.)