Skip to content
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

Merged
merged 1 commit into from
Jun 14, 2016
Merged

[docs] GS added #534

merged 1 commit into from
Jun 14, 2016

Conversation

MargaritaLoseva
Copy link
Contributor

@MargaritaLoseva MargaritaLoseva commented May 13, 2016

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.)

@testcafe-build-bot
Copy link
Collaborator

✅ Tests for the commit 316c20b have passed. See details.


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.
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@inikulin
Copy link
Contributor

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:

  • Install
  • Test code structure
  • User actions
  • Observing page state
  • Adding assertions
  • Running tests and getting results

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.

@inikulin
Copy link
Contributor

\r-

@testcafe-build-bot
Copy link
Collaborator

❌ Tests for the commit 7276225 have failed. See details.

@testcafe-build-bot
Copy link
Collaborator

❌ Tests for the commit b21b4f1 have failed. See details.

@MargaritaLoseva
Copy link
Contributor Author

FPR

@inikulin
Copy link
Contributor

\cc @DevExpress/testcafe-docs I'll take a look a little bit later. Can someone else review for now?

@AlexanderMoskovkin
Copy link
Contributor

@MargaritaLoseva Tests are failed. It seems some links are broken

@MargaritaLoseva
Copy link
Contributor Author

@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!');
};
Copy link
Collaborator

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.
Copy link
Contributor

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.

@inikulin
Copy link
Contributor

inikulin commented Jun 8, 2016

\r-

@testcafe-build-bot
Copy link
Collaborator

❌ Tests for the commit 97e73a2 have failed. See details.

test('Test1', async t => {
// Test code
});
```
Copy link
Collaborator

@VasilyStrelyaev VasilyStrelyaev Jun 9, 2016

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:

  1. show the code growing step-by-step,
  2. first show the code and then describe.

Copy link
Contributor

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

Copy link
Contributor Author

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

Copy link
Contributor

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.

Copy link
Collaborator

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

Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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

Copy link
Contributor

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.

@VasilyStrelyaev
Copy link
Collaborator

\r-

@testcafe-build-bot
Copy link
Collaborator

❌ Tests for the commit 90ec5d0 have failed. See details.

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.
Copy link
Collaborator

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.

@VasilyStrelyaev
Copy link
Collaborator

\r-

@testcafe-build-bot
Copy link
Collaborator

❌ Tests for the commit fc6192f have failed. See details.

@VasilyStrelyaev
Copy link
Collaborator

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}`));
Copy link
Contributor

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

@inikulin
Copy link
Contributor

lgtm

@MargaritaLoseva
Copy link
Contributor Author

\cc @DevExpress/testcafe-docs
Please review

@testcafe-build-bot
Copy link
Collaborator

❌ Tests for the commit ccfef9e have failed. See details.

@AlexanderMoskovkin
Copy link
Contributor

We show how to run a test from the command line. Should we say in Getting started that it is possible to use testCafe as a nodejs module and give a link to the Programming Interface topic?

@inikulin
Copy link
Contributor

We show how to run a test from the command line. Should we say in Getting started that it is possible to use testCafe as a nodejs module and give a link to the Programming Interface topic?

No, this is advanced topic and more likely will be needed only for embedders.

@AlexanderMoskovkin
Copy link
Contributor

lgtm

@MargaritaLoseva
Copy link
Contributor Author

@kirovboris, @churkin please review

@kirovboris
Copy link
Collaborator

lgtm

1 similar comment
@churkin
Copy link
Contributor

churkin commented Jun 14, 2016

lgtm

@churkin
Copy link
Contributor

churkin commented Jun 14, 2016

@testcafe-build-bot \retest

@churkin churkin merged commit 29a02d2 into DevExpress:master Jun 14, 2016
@AlexanderMoskovkin
Copy link
Contributor

@MargaritaLoseva are failed tests ok for now?

@MargaritaLoseva
Copy link
Contributor Author

MargaritaLoseva commented Jun 14, 2016

Tests still fail due to broken links as @VasilyStrelyaev doesn't pull topics about API yet.

kirovboris pushed a commit to kirovboris/testcafe-phoenix that referenced this pull request Dec 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docs: a Getting Started tutorial required
7 participants