diff --git a/src/test/java/com/mathworks/ci/systemTests/GlobalToolIT.java b/src/test/java/com/mathworks/ci/systemTests/GlobalToolIT.java index 878a6055..9660f4e7 100644 --- a/src/test/java/com/mathworks/ci/systemTests/GlobalToolIT.java +++ b/src/test/java/com/mathworks/ci/systemTests/GlobalToolIT.java @@ -110,7 +110,7 @@ public void verifyAllToolsAreAvailable() throws Exception { HtmlPage configurePage = jenkins.createWebClient().goTo("job/test0/configure"); HtmlCheckBoxInput matlabVer = configurePage.getElementByName("com-mathworks-ci-UseMatlabVersionBuildWrapper"); matlabVer.setChecked(true); - Thread.sleep(2000); + HtmlSelect matlabOptions = (HtmlSelect) configurePage.getByXPath("//select[contains(@class, \"dropdownList\")]").get(1); assertEquals(matlabOptions.getOption(0).getValueAttribute(),"MATLAB_PATH_1"); assertEquals(matlabOptions.getOption(1).getValueAttribute(),"MATLAB_PATH_2"); diff --git a/src/test/java/com/mathworks/ci/systemTests/RunMATLABTestsArtifactsIT.java b/src/test/java/com/mathworks/ci/systemTests/RunMATLABTestsArtifactsIT.java index 5c59ede3..30de9541 100644 --- a/src/test/java/com/mathworks/ci/systemTests/RunMATLABTestsArtifactsIT.java +++ b/src/test/java/com/mathworks/ci/systemTests/RunMATLABTestsArtifactsIT.java @@ -79,7 +79,6 @@ public void verifyJUnitFilePathInput() throws Exception{ HtmlPage page = jenkins.createWebClient().goTo("job/test0/configure"); HtmlCheckBoxInput junitChkbx = page.getElementByName("junitArtifact"); junitChkbx.setChecked(true); - Thread.sleep(2000); HtmlTextInput junitFilePathInput = (HtmlTextInput) page.getElementByName("_.junitReportFilePath"); Assert.assertEquals(TestMessage.getValue("junit.file.path"),junitFilePathInput.getValueAttribute()); @@ -94,7 +93,6 @@ public void verifyTAPTestFilePathInput() throws Exception{ HtmlPage page = jenkins.createWebClient().goTo("job/test0/configure"); HtmlCheckBoxInput tapChkbx = page.getElementByName("tapArtifact"); tapChkbx.setChecked(true); - Thread.sleep(2000); HtmlTextInput tapFilePathInput = (HtmlTextInput) page.getElementByName("_.tapReportFilePath"); Assert.assertEquals(TestMessage.getValue("taptestresult.file.path"),tapFilePathInput.getValueAttribute()); @@ -110,7 +108,6 @@ public void verifyPDFReportFilePathInput() throws Exception{ HtmlPage page = jenkins.createWebClient().goTo("job/test0/configure"); HtmlCheckBoxInput pdfChkbx = page.getElementByName("pdfReportArtifact"); pdfChkbx.setChecked(true); - Thread.sleep(2000); HtmlTextInput PDFFilePathInput=(HtmlTextInput) page.getElementByName("_.pdfReportFilePath"); Assert.assertEquals(TestMessage.getValue("pdftestreport.file.path"),PDFFilePathInput.getValueAttribute()); @@ -125,7 +122,6 @@ public void verifyCoberturaFilePathInput() throws Exception { HtmlPage page = jenkins.createWebClient().goTo("job/test0/configure"); HtmlCheckBoxInput coberturaChkBx = page.getElementByName("coberturaArtifact"); coberturaChkBx.setChecked(true); - Thread.sleep(2000); HtmlTextInput coberturaCodeCoverageFileInput=(HtmlTextInput) page.getElementByName("_.coberturaReportFilePath"); Assert.assertEquals(TestMessage.getValue("cobertura.file.path"),coberturaCodeCoverageFileInput.getValueAttribute()); @@ -141,7 +137,6 @@ public void verifyModelCoverageFilePathInput() throws Exception { HtmlPage page = jenkins.createWebClient().goTo("job/test0/configure"); HtmlCheckBoxInput modelCoverageChkBx = page.getElementByName("modelCoverageArtifact"); modelCoverageChkBx.setChecked(true); - Thread.sleep(2000); HtmlTextInput coberturaModelCoverageFileInput=(HtmlTextInput) page.getElementByName("_.modelCoverageFilePath"); Assert.assertEquals(TestMessage.getValue("modelcoverage.file.path"),coberturaModelCoverageFileInput.getValueAttribute()); @@ -157,7 +152,6 @@ public void verifySTMResultsFilePathInput() throws Exception { HtmlPage page = jenkins.createWebClient().goTo("job/test0/configure"); HtmlCheckBoxInput stmResultsChkBx = page.getElementByName("stmResultsArtifact"); stmResultsChkBx.setChecked(true); - Thread.sleep(2000); HtmlTextInput STMRFilePathInput=(HtmlTextInput) page.getElementByName("_.stmResultsFilePath"); Assert.assertEquals(TestMessage.getValue("stmresults.file.path"),STMRFilePathInput.getValueAttribute()); @@ -208,7 +202,7 @@ public void verifyCustomFilenamesForArtifactsPipeline() throws Exception { " {\n" + " unzip '" + Utilities.getRunMATLABTestsData().getPath() + "'" + "\n" + " runMATLABTests(sourceFolder:['src'], testResultsTAP: 'test-results/results.tap',\n" + - " testResultsPDF: 'test-results/results.pdf'\n" + + " testResultsPDF: 'test-results/results.pdf',\n" + " testResultsJUnit: 'test-results/results.xml',\n" + " testResultsSimulinkTest: 'test-results/results.mldatx',\n" + " codeCoverageCobertura: 'code-coverage/coverage.xml',\n" + diff --git a/src/test/java/com/mathworks/ci/systemTests/RunMATLABTestsIT.java b/src/test/java/com/mathworks/ci/systemTests/RunMATLABTestsIT.java index f52b9def..b3eafc7d 100644 --- a/src/test/java/com/mathworks/ci/systemTests/RunMATLABTestsIT.java +++ b/src/test/java/com/mathworks/ci/systemTests/RunMATLABTestsIT.java @@ -115,6 +115,7 @@ public void verifySourceFolderDefaultState() throws Exception { HtmlPage page = jenkins.createWebClient().goTo("job/test0/configure"); HtmlCheckBoxInput sourceFolder = page.getElementByName("_.sourceFolder"); sourceFolder.click(); + WebAssert.assertElementPresentByXPath(page, "//input[@name=\"_.srcFolderPath\"]"); HtmlInput srcFolderPath = page.getElementByName("_.srcFolderPath"); assertEquals("", srcFolderPath.getTextContent()); @@ -126,7 +127,7 @@ public void verifySelectByFolderDefaultState() throws Exception { HtmlPage page = jenkins.createWebClient().goTo("job/test0/configure"); HtmlCheckBoxInput sourceFolder = page.getElementByName("_.selectByFolder"); sourceFolder.click(); - Thread.sleep(2000); + WebAssert.assertElementPresentByXPath(page, "//input[@name=\"_.testFolders\"]"); HtmlInput srcFolderPath = page.getElementByName("_.testFolders"); assertEquals("", srcFolderPath.getTextContent()); @@ -138,7 +139,7 @@ public void verifySelectByTagDefaultState() throws Exception { HtmlPage page = jenkins.createWebClient().goTo("job/test0/configure"); HtmlCheckBoxInput sourceFolder = page.getElementByName("_.selectByTag"); sourceFolder.click(); - Thread.sleep(2000); + WebAssert.assertElementPresentByXPath(page, "//input[@name=\"_.testTag\"]"); HtmlInput srcFolderPath = page.getElementByName("_.testTag"); assertEquals("", srcFolderPath.getTextContent());