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

Rework selenium tests from organizations package #7389

Merged
merged 12 commits into from
Nov 16, 2017

Conversation

SkorikSergey
Copy link
Contributor

What does this PR do?

We need rework selenium tests from organizations package:

  • delete unused user;
  • delete test methods with similar use cases;
  • create selenium test for checking organization creation;
  • stabilize methods from page objects.

What issues does this PR fix or reference?

#7121

@SkorikSergey SkorikSergey added kind/task Internal things, technical debt, and to-do tasks to be performed. status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. team/production labels Nov 15, 2017
*
* @author Ann Shumilova
*/
public class DeleteOrganizationTest {
private static final String PARENT_ORG_NAME = generate("organization", 5);
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's add "parent-" prefix to the name to simplify test result review.

*
* @author Ann Shumilova
*/
public class DeleteOrganizationTest {
private static final String PARENT_ORG_NAME = generate("organization", 5);
private static final String CHILD_ORG_NAME = generate("organization", 5);
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's add "child-" prefix to the name to simplify test result review.

testOrganizationServiceClient.deleteById(childOrganization.getId());
testOrganizationServiceClient.deleteById(parentOrganization.getId());
for (OrganizationDto organization : organizations)
testOrganizationServiceClient.deleteById(organization.getId());
Copy link
Contributor

Choose a reason for hiding this comment

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

Such code can affect organizations which are created in parallel threads of test execution.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The Organizations list includes only organizations from this test.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see.
organizations field is used for tearDown() method only.
To simplify the code, we could avoid usage of organizations field at all and to remove two organizations explicitly instead:

testOrganizationServiceClient.deleteById(childOrganization.getId());
testOrganizationServiceClient.deleteById(parentOrganization.getId());

public void testSubOrganizationRename() {
String organizationPath = NEW_PARENT_ORG_NAME + "/" + CHILD_ORG_NAME;
String path = NEW_PARENT_ORG_NAME + "/" + NEW_CHILD_ORG_NAME;
Copy link
Contributor

Choose a reason for hiding this comment

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

assertFalse(organizationPage.isWorkspaceCapReadonly());
assertFalse(organizationPage.isRunningCapReadonly());
assertFalse(organizationPage.isRAMCapReadonly());
assertFalse(organizationPage.isWorkspaceCapReadonly());
Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch!

@dmytro-ndp
Copy link
Contributor

dmytro-ndp commented Nov 15, 2017

It seems the most notices from previous pull request were fixed in the request.

@SkorikSergey SkorikSergey merged commit c304c4a into master Nov 16, 2017
@benoitf benoitf removed the status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. label Nov 16, 2017
@benoitf benoitf added this to the 5.21.0 milestone Nov 16, 2017
@SkorikSergey SkorikSergey deleted the reworkOrganizationTests branch November 16, 2017 15:41
dmytro-ndp pushed a commit that referenced this pull request Dec 8, 2017
* reworked deleting organizations in AfterClass, deleted unused user, deleted test methods with similar use cases, created selenium test for checking organization creation.
* selenium tests reworked for starting in test suites
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/task Internal things, technical debt, and to-do tasks to be performed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants