Conversation
Creating project structure, dependencies and first test
pedrohyvo
left a comment
There was a problem hiding this comment.
@isramodus there are a few files under ".idea" folder, could you take a look them, please
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()); |
| return pageTitle.getText(); | ||
| } | ||
|
|
||
| public void openDropDown(){dropdown.click();} |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
@kenil-fadia I'll connect with you to help me out with this.
|
|
||
| } | ||
|
|
||
| public String returnDropdownValue(){ |
There was a problem hiding this comment.
Accept the web Element as a parameter.
|
|
||
| @BeforeClass | ||
| public void beforeClass () { | ||
| System.setProperty("webdriver.chrome.driver", "./src/test/resources/chromedriver/chromedriver.exe"); |
There was a problem hiding this comment.
Please make use of webdriver binaries -
Automatically download WebDriver Binaries
Let me know if you need any help here.
There was a problem hiding this comment.
@kenil-fadia I need your help to resolve this.
| } | ||
|
|
||
| @Test(priority = 2) | ||
| public void clickCheckboxes(){ |
There was a problem hiding this comment.
All the tests should be independent of each other.
| return pageTitle.getText(); | ||
| } | ||
|
|
||
|
|
|
|
||
|
|
||
| public void clickCheckbox(){ | ||
| check1.click(); |
| navigateBackHome(); | ||
| homePage.clickOption("Checkboxes"); | ||
| Assert.assertEquals("Checkboxes", checkboxesPage.getTitleText()); | ||
| Thread.sleep(1000); |
There was a problem hiding this comment.
Since this is a demo repo it's not critical, but we should avoid these when possible.
| public void clickCheckbox(){ | ||
| check1.click(); | ||
| } | ||
|
|
||
| public boolean getCheckboxState1(){return check1.isSelected();} | ||
|
|
||
| public void unclickSecondCheckbox(){check2.click();} | ||
|
|
||
| public boolean getCheckboxState2(){return check2.isSelected();} |
There was a problem hiding this comment.
Again, not critical for a demo repo, but for the next iteration we could refactor these because a lot of the code is repeating.
|
Overall, it looks good. Left 2 remarks. Nothing to add to what's been already pointed out. |
Creating project structure, dependencies and first test
https://moduscreate.atlassian.net/browse/QACOE-244