Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jakarta snippet support test implementation #373

Open
wants to merge 35 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
a14a2ea
update package.json for new tests
gilbysunil14 Nov 8, 2024
61f4d45
test for checking snippet rest_class
gilbysunil14 Nov 8, 2024
b7e2dcb
new resource for checking snippets completion
gilbysunil14 Nov 8, 2024
d86ff94
Code improvements
gilbysunil14 Nov 12, 2024
7cdd821
Revert "Code improvements"
gilbysunil14 Nov 12, 2024
5114a6a
Code improvements
gilbysunil14 Nov 12, 2024
89e6715
removed tests added as part of lsp4jakarta
gilbysunil14 Nov 12, 2024
dcea4c9
performance improvement
gilbysunil14 Nov 12, 2024
d7035e2
Added delays so that the cron jobs will be passed
gilbysunil14 Nov 12, 2024
cedb53f
Revert "Added delays so that the cron jobs will be passed"
gilbysunil14 Nov 12, 2024
c9af344
checking cron jobs
gilbysunil14 Nov 15, 2024
b1e81a8
corrections in code
gilbysunil14 Nov 20, 2024
d15c57f
increase timeout for gha
gilbysunil14 Dec 6, 2024
99de4ce
delay for toggling content assist
gilbysunil14 Dec 12, 2024
69b2c42
check content assist issue
gilbysunil14 Dec 12, 2024
668ea05
debug assis items
gilbysunil14 Dec 12, 2024
1183a17
Revert "debug assis items"
gilbysunil14 Dec 12, 2024
153b282
debug content assist items
gilbysunil14 Dec 12, 2024
acdc5ed
added new file
gilbysunil14 Dec 12, 2024
795b769
change in resource file
gilbysunil14 Dec 12, 2024
49153cc
helloservlet resource
gilbysunil14 Dec 12, 2024
5b16dd4
delay to start language server
gilbysunil14 Dec 12, 2024
5c2eb25
test using servlet resource
gilbysunil14 Dec 12, 2024
27c0dc0
checking new action to copy screenshots
gilbysunil14 Dec 17, 2024
c14c64c
added retention
gilbysunil14 Dec 17, 2024
84bdda9
artifact in linux only
gilbysunil14 Dec 17, 2024
b9c731f
logs to see if files are copied
gilbysunil14 Dec 17, 2024
abc7592
commented archives
gilbysunil14 Dec 18, 2024
ae3c8f1
changed folder to images
gilbysunil14 Dec 18, 2024
ef62e2e
include all folders
gilbysunil14 Dec 18, 2024
16802de
if always condition
gilbysunil14 Dec 23, 2024
1919b12
changed archive name
gilbysunil14 Jan 2, 2025
9910ae8
remove archive screenshot related changes
gilbysunil14 Jan 14, 2025
cc24e9c
remove spaces
gilbysunil14 Jan 14, 2025
bdfb931
fix indentation and removed unnecessary logs
gilbysunil14 Jan 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions src/test/GradleSingleModJakartaLSTest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { TextEditor, EditorView, VSBrowser } from 'vscode-extension-tester';
import * as utils from './utils/testUtils';
import * as path from 'path';
import * as assert from 'assert';

describe('LSP4Jakarta LS test for snippet test', () => {

let editor: TextEditor;

it('check if correct code is inserted when rest_class snippet is triggered', async() => {
await VSBrowser.instance.openResources(path.join(utils.getGradleProjectPath(), "src", "main", "java", "test", "gradle", "liberty", "web", "app", "SystemResource.java"));

editor = await new EditorView().openEditor('SystemResource.java') as TextEditor;

const textPressent = await editor.getText();
if(textPressent.length > 0){
await editor.clearText();
}

await utils.delay(85000);
await editor.typeText("rest");
await utils.delay(6000);

//open the assistant
const assist = await editor.toggleContentAssist(true);
await utils.delay(6000);
// toggle can return void, so we need to make sure the object is present
if (assist) {
// to select an item use
await assist.select('rest_class');
}
await utils.delay(6000);

// close the assistant
await editor.toggleContentAssist(false);

const insertedCode = await editor.getText();
await utils.delay(6000);
assert(insertedCode.includes('public String methodname() {'), 'Snippet rest_class was not inserted correctly.');

await editor.clearText();
await editor.save();
}).timeout(475000);

});
Loading