Skip to content

Commit

Permalink
Remove sleep statements
Browse files Browse the repository at this point in the history
  • Loading branch information
Vahila committed Feb 4, 2025
1 parent 30e5eb0 commit 0abb319
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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());
Expand All @@ -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());
Expand All @@ -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());
Expand All @@ -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());
Expand All @@ -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());
Expand Down Expand Up @@ -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" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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());
Expand All @@ -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());
Expand Down

0 comments on commit 0abb319

Please sign in to comment.