diff --git a/src/test/GradleSingleModLCLSTest.ts b/src/test/GradleSingleModLCLSTest.ts index 9dfdf1e6..75518263 100755 --- a/src/test/GradleSingleModLCLSTest.ts +++ b/src/test/GradleSingleModLCLSTest.ts @@ -253,6 +253,38 @@ describe('LCLS tests for Gradle Project', function () { }).timeout(25000); + it('Should show diagnostic for invalid value in server.xml for server feature', async () => { + const section = await new SideBarView().getContent().getSection(constants.GRADLE_PROJECT); + section.expand(); + await VSBrowser.instance.openResources(path.join(utils.getGradleProjectPath(), 'src', 'main', 'liberty', 'config2', 'server.xml')); + + editor = await new EditorView().openEditor('server.xml') as TextEditor; + const stanzaSnipet = "servlet"; + const expectedDiagnosticData = `ERROR: The "servlet" versionless feature cannot be resolved since there are more than one common platform. Specify a platform or a feature with a version to enable resolution`; + await editor.typeTextAt(15, 35, '\n'); + await editor.typeTextAt(16, 9, stanzaSnipet); + await utils.delay(2000); + const focusTargtElemnt = await editor.findElement(By.xpath("//*[contains(text(), '\servlet\')]")); + await utils.delay(3000); + focusTargtElemnt.click(); + await editor.click(); + + const actns = VSBrowser.instance.driver.actions(); + await actns.move({ origin: focusTargtElemnt }).perform(); + await utils.delay(5000); + + const hverContent = editor.findElement(By.className('hover-contents')); + const hverValue = await hverContent.getText(); + console.log("Hover text:" + hverValue); + + assert(hverValue.includes(expectedDiagnosticData), 'Did not get expected diagnostic in server.xml server feature'); + + editor.clearText(); + editor.setText(actualSeverXMLContent); + console.log("Content restored"); + + }).timeout(38000); + it('Should apply quick fix for invalid value in server.xml for server feature', async () => { const section = await new SideBarView().getContent().getSection(constants.GRADLE_PROJECT); section.expand();