Skip to content
This repository has been archived by the owner on Jan 26, 2021. It is now read-only.

Document automated testing in VMS #782

Merged
merged 1 commit into from
Aug 3, 2018

Conversation

Monal5031
Copy link
Contributor

Description

This PR documents the automated testing in VMS.
Fixes #779

Type of Change:

  • Quality Assurance
  • Documentation

Code/Quality Assurance Only

  • Bug fix (non-breaking change which fixes an issue)
  • This change requires a documentation update (software upgrade on readme file)
  • New feature (non-breaking change which adds functionality pre-approved by mentors)

How Has This Been Tested?

N/A?

Checklist:

  • My PR follows the style guidelines of this project
  • I have performed a self-review of my own code or materials
  • I have commented my code or provided relevant documentation, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • Any dependent changes have been merged

Code/Quality Assurance Only

  • My changes generate no new warnings
  • My PR currently breaks something (fix or feature that would cause existing functionality to not work as expected)
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been published in downstream modules

@Monal5031 Monal5031 added Type: Enhancement New feature or request. Category: Documentation/Training Improvements or additions to documentation. Program: GSOC Related to work completed during the Google Summer of Code Program. labels Jul 4, 2018
Copy link
Contributor

@naman1901 naman1901 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use pronouns such as 'you', 'your', etc. Make sure you change sentence structure accordingly.

@@ -23,7 +23,7 @@ The QA process is divided as follows:

- So, each testcase Class inherits `LiveServerTestCase`, Contains a `setUp`
and `tearDown` method to instantiate and end live-server respectively.
Each testcase in the class begins with `test`.
Each Test Case in the class begins with `test`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

testcase is fine. If you want to break into two words, don't capitalize the words.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. 👍

@@ -47,3 +47,35 @@ The QA process is divided as follows:

- To follow up changes in UI with changes in tests, the modifications need to be made only
in the relevant locators/urls/page file.

- Addition of any new view implies that a pom `page` and `locator` corresponding to that
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"...implies that corresponding pom page and locator need to be created". Be concise.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 👍


## Important points regarding creation of new Test Class:

- As mentioned earlier, each Test Class corresponds to a view and which has a corresponding
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"view and which" to "view which"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 👍

- As mentioned earlier, each Test Class corresponds to a view and which has a corresponding
pom page and locator.

- When you are creating a new Test Class, first identify the view you are creating the Class for
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not address a person using pronouns. "When creating a new test class, first identify the view the class is being created for, and create corresponding the pom page and locator."

Again, be concise. Also, don't capitalize words randomly (like ...creating the Class... here)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 👍

- Use of implicit waits should always be avoided unless needed in an extreme case and has the
approval of a maintainer. If wait is needed use explicit waits instead.

- Tests in normal mode might fail if all are executed at once, but if a test is failing in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fails in

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 👍

@@ -0,0 +1,103 @@
## Steps to run tests:

Following 4 points are to be followed only once to setup repository.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"A one-time setup requires the following four steps"

Prefer words intext over numerals.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 👍

virtualenv -p python3.6 venv
```

Following points are needed at start of every session of work.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"To start a testing session"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or just session, as you please.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 👍

:Note: If you are using Windows then see this link to configure geckodriver in your environment
https://stackoverflow.com/a/40208762

- To execute all the tests in the VMS, use this command:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To execute all tests in VMS:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 👍

@anitab-org anitab-org deleted a comment Jul 5, 2018
@anitab-org anitab-org deleted a comment Jul 5, 2018
@anitab-org anitab-org deleted a comment Jul 5, 2018
@anitab-org anitab-org deleted a comment Jul 5, 2018
@anitab-org anitab-org deleted a comment Jul 5, 2018
@anitab-org anitab-org deleted a comment Jul 5, 2018
@anitab-org anitab-org deleted a comment Jul 5, 2018
@Monal5031
Copy link
Contributor Author

Thanks @naman1901 for the review, done with changes please review again.

@anitab-org anitab-org deleted a comment Jul 5, 2018
@anitab-org anitab-org deleted a comment Jul 5, 2018
@anitab-org anitab-org deleted a comment Jul 5, 2018
@@ -0,0 +1,12 @@
There are a few tests which have been commented out currently to avoid travis build failure:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capitalize Travis. Replace with Travis CI, maybe. This is an official doc. You need it to be as perfect as possible.

```

- Automated tests in VMS require you to setup geckodriver in your path, for that
you can either run this command in root of project:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...path. For that, either run the following command in....

```bash
bash setup-geckodriver.sh
```
OR you can run these commands:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no you

tar -xzvf geckodriver-v0.20.1-linux64.tar.gz
sudo mv geckodriver /usr/local/bin
```
:Note: If you are using Windows then see this link to configure geckodriver in your environment
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be okay to write you here because conditional to the user.

python manage.py test <app_name>.tests.<test_file_name> -v 2
```

- For the automated tests, if you have configured geckodriver correctly then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if geckodriver has been configured correctly...

@anitab-org anitab-org deleted a comment Jul 11, 2018
@anitab-org anitab-org deleted a comment Jul 11, 2018
@anitab-org anitab-org deleted a comment Jul 11, 2018
@anitab-org anitab-org deleted a comment Jul 24, 2018
@anitab-org anitab-org deleted a comment Jul 24, 2018
Copy link

@ayushgarg1804 ayushgarg1804 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

travis :/

@Monal5031
Copy link
Contributor Author

@ayushgarg1804 Travis is getting weird sometimes now, it just needs a rebuild it'll fix automatically. I'll do it in afternoon. ( On mobile atm so can't restart the build)

@Monal5031 Monal5031 requested a review from naman1901 July 27, 2018 21:24
@ayushgarg1804
Copy link

That's quite strange.

@anitab-org anitab-org deleted a comment Jul 30, 2018
@anitab-org anitab-org deleted a comment Jul 30, 2018
@anitab-org anitab-org deleted a comment Jul 30, 2018
naman1901
naman1901 previously approved these changes Jul 30, 2018
MehaKaushik
MehaKaushik previously approved these changes Aug 1, 2018
@naman1901
Copy link
Contributor

@Monal5031 please resolve the conflict

@Monal5031 Monal5031 dismissed stale reviews from MehaKaushik and naman1901 via 1fd984c August 1, 2018 15:28
@anitab-org anitab-org deleted a comment Aug 1, 2018
@anitab-org anitab-org deleted a comment Aug 1, 2018
@anitab-org anitab-org deleted a comment Aug 1, 2018
@anitab-org anitab-org deleted a comment Aug 1, 2018
@anitab-org anitab-org deleted a comment Aug 1, 2018
@anitab-org anitab-org deleted a comment Aug 1, 2018
@ayushgarg1804 ayushgarg1804 merged commit 26ee7ec into anitab-org:gsoc18-infra Aug 3, 2018
@Monal5031 Monal5031 deleted the documentation branch August 11, 2018 14:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Category: Documentation/Training Improvements or additions to documentation. Program: GSOC Related to work completed during the Google Summer of Code Program. Type: Enhancement New feature or request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants