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

Initializing seleniumJavaExperiment #12

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Initializing seleniumJavaExperiment #12

wants to merge 8 commits into from

Conversation

isramodus
Copy link
Collaborator

@isramodus isramodus commented Jan 28, 2022

Creating project structure, dependencies and first test

https://moduscreate.atlassian.net/browse/QACOE-244

Creating project structure, dependencies and first test
Copy link
Contributor

@pedrohyvo pedrohyvo left a comment

Choose a reason for hiding this comment

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

@isramodus there are a few files under ".idea" folder, could you take a look them, please

seleniumJavaExperiment/.gitignore Outdated Show resolved Hide resolved
isramodus and others added 4 commits January 28, 2022 13:30
Solving PR comments. Addressed in .gitignore file
First PR of clicking checkbox using Selenium
Completed automation of checkbox selection and assertion.
dropdownpage.openDropDown();
dropdownpage.selectOptions("Option 2");
dropdownpage.openDropDown();
System.out.println(dropdownpage.returnDropdownValue());

Choose a reason for hiding this comment

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

Avoid logs if possible.

return pageTitle.getText();
}

public void openDropDown(){dropdown.click();}

Choose a reason for hiding this comment

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

When using select, you do not need to open the dropdown. You can directly use select.

Select opt= new Select(dropdown);
WebElement dropdownx= opt.getFirstSelectedOption();
String value= dropdownx.getText();
return value;

Choose a reason for hiding this comment

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

Please fix the indentations.

Copy link

Choose a reason for hiding this comment

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

@kenil-fadia I'll connect with you to help me out with this.


}

public String returnDropdownValue(){

Choose a reason for hiding this comment

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

Accept the web Element as a parameter.


@BeforeClass
public void beforeClass () {
System.setProperty("webdriver.chrome.driver", "./src/test/resources/chromedriver/chromedriver.exe");

Choose a reason for hiding this comment

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

Please make use of webdriver binaries -
Automatically download WebDriver Binaries

Let me know if you need any help here.

Copy link

@asimkm asimkm Feb 28, 2022

Choose a reason for hiding this comment

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

@kenil-fadia I need your help to resolve this.

}

@Test(priority = 2)
public void clickCheckboxes(){

Choose a reason for hiding this comment

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

All the tests should be independent of each other.

return pageTitle.getText();
}


Choose a reason for hiding this comment

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

Remove unwanted line breaks.



public void clickCheckbox(){
check1.click();

Choose a reason for hiding this comment

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

Fix the indentation

navigateBackHome();
homePage.clickOption("Checkboxes");
Assert.assertEquals("Checkboxes", checkboxesPage.getTitleText());
Thread.sleep(1000);

Choose a reason for hiding this comment

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

Since this is a demo repo it's not critical, but we should avoid these when possible.

Comment on lines 20 to 28
public void clickCheckbox(){
check1.click();
}

public boolean getCheckboxState1(){return check1.isSelected();}

public void unclickSecondCheckbox(){check2.click();}

public boolean getCheckboxState2(){return check2.isSelected();}

Choose a reason for hiding this comment

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

Again, not critical for a demo repo, but for the next iteration we could refactor these because a lot of the code is repeating.

@Sergiu-B
Copy link

Overall, it looks good. Left 2 remarks. Nothing to add to what's been already pointed out.

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.

5 participants