Skip to content

Commit

Permalink
Code modified for add new config folder
Browse files Browse the repository at this point in the history
  • Loading branch information
SuparnaSuresh committed Dec 5, 2024
1 parent 3f37a85 commit d41e42b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
29 changes: 14 additions & 15 deletions src/test/GradleSingleModLCLSTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ import * as constants from './definitions/constants';
const path = require('path');
const assert = require('assert');

describe('LCLS Test for Gradle Project', function () {
describe('LCLS tests for Gradle Project', function () {
let editor: TextEditor;

before(() => {
utils.copyConfig(path.join(utils.getGradleProjectPath(), 'src', 'main', 'liberty', 'config'),path.join(utils.getGradleProjectPath(), 'src', 'main', 'liberty', 'config2'));
});

it('should apply quick fix for invalid value in server.xml', async () => {
it('Should apply quick fix for invalid value in server.xml', 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'));
Expand Down Expand Up @@ -71,31 +71,30 @@ describe('LCLS Test for Gradle Project', function () {
}).timeout(38000);


it('should show hover support for server.env', async () => {
it('Should show hover support for server.env', 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.env'));
editor = await new EditorView().openEditor('server.env') as TextEditor;

const actualContent = editor.getText();
const testHoverTarget = "WLP_LOGGING_CONSOLE_LOGLEVEL=AUDIT";
const hoverExpectedOutcome = "This setting controls the granularity of messages that go to the console. The valid values are INFO, AUDIT, WARNING, ERROR, and OFF. The default is AUDIT. If using with the Eclipse developer tools this must be set to the default.";
await editor.typeTextAt(1, 1, testHoverTarget);
const testHverTarget = "WLP_LOGGING_CONSOLE_LOGLEVEL=AUDIT";
const hverExpectdOutcome = "This setting controls the granularity of messages that go to the console. The valid values are INFO, AUDIT, WARNING, ERROR, and OFF. The default is AUDIT. If using with the Eclipse developer tools this must be set to the default.";
await editor.typeTextAt(1, 1, testHverTarget);
await utils.delay(2000);
const focusTargetLement = editor.findElement(By.xpath("//*[contains(text(), 'LOGLEVEL')]"));
const focusTargtElemnt = editor.findElement(By.xpath("//*[contains(text(), 'LOGLEVEL')]"));
await utils.delay(3000);
focusTargetLement.click();
focusTargtElemnt.click();
await editor.click();

const actions = VSBrowser.instance.driver.actions();
await actions.move({ origin: focusTargetLement }).perform();
const actns = VSBrowser.instance.driver.actions();
await actns.move({ origin: focusTargtElemnt }).perform();
await utils.delay(5000);

const hoverContents = editor.findElement(By.className('hover-contents'));
const hoverValue = await hoverContents.getText();
console.log("hover text:" + hoverValue);
assert(hoverValue === (hoverExpectedOutcome), 'Did not get expected hover data.');
const hverContent = editor.findElement(By.className('hover-contents'));
const hverValue = await hverContent.getText();
console.log("Hover text:" + hverValue);
assert(hverValue === (hverExpectdOutcome), 'Did not get expected hover data.');
await editor.clearText();

}).timeout(25000);
Expand Down
1 change: 1 addition & 0 deletions src/test/utils/testUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ export async function clearCommandPalette() {
expect(buttons.length).equals(2);
await dialog.pushButton('Clear');
}

/**
* Remove newly created Project folder with content
*/
Expand Down

0 comments on commit d41e42b

Please sign in to comment.