Skip to content

Commit 5409db8

Browse files
hlshenjoehan
andauthored
Set Graphql Syntax Highlighter as an extension dependency (#8739)
* fix integration tests * set graphql syntax highlighter as an extension dependency --------- Co-authored-by: joehan <[email protected]>
1 parent 8b8b9ca commit 5409db8

File tree

8 files changed

+22
-43
lines changed

8 files changed

+22
-43
lines changed

firebase-vscode/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
## NEXT
22

3+
- [Changed] Graphql Syntax Highlighter is now an extension dependency
4+
35
## 1.4.1
46

57
- Update internal `firebase-tools` dependency to 14.6.0

firebase-vscode/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"repository": "https://github.com/firebase/firebase-tools",
1212
"sideEffects": false,
1313
"extensionDependencies": [
14-
"google.geminicodeassist"
14+
"google.geminicodeassist",
15+
"graphql.vscode-graphql-syntax"
1516
],
1617
"categories": [
1718
"Other"
@@ -216,7 +217,8 @@
216217
"test-compile": "npm run copyfiles && webpack --config src/test/webpack.test.js",
217218
"lint": "eslint src --ext ts",
218219
"test": "npm run test:unit && npm run test:e2e",
219-
"pretest:e2e": "curl -fsSL https://code-server.dev/install.sh | sh -s -- --edge && code-server --install-extension Google.geminicodeassist --extensions-dir ./prebuilt-extensions/",
220+
"install:extensions": "code-server --install-extension Google.geminicodeassist --extensions-dir ./prebuilt-extensions/ && code-server --install-extension graphql.vscode-graphql-syntax --extensions-dir ./prebuilt-extensions/",
221+
"pretest:e2e": "curl -fsSL https://code-server.dev/install.sh | sh -s -- --edge && npm run install:extensions",
220222
"pretest:unit": "npm run test-compile && tsc -p src/test/tsconfig.test.json",
221223
"test:unit": "node ./dist/test/firebase-vscode/src/test/runTest.js",
222224
"test:e2e": "npm run test:e2e:empty && npm run test:e2e:fishfood",

firebase-vscode/src/data-connect/graphql-syntax-highlighter.ts

Lines changed: 0 additions & 30 deletions
This file was deleted.

firebase-vscode/src/extension.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,12 @@ import { AuthService } from "./auth/service";
2121
import { AnalyticsLogger, IDX_METRIC_NOTICE } from "./analytics";
2222
import { env } from "./core/env";
2323

24-
import { suggestGraphqlSyntaxExtension } from "./data-connect/graphql-syntax-highlighter";
2524
import { setIsVSCodeExtension } from "../../src/vsCodeUtils";
2625

2726
// This method is called when your extension is activated
2827
export async function activate(context: vscode.ExtensionContext) {
2928
const analyticsLogger = new AnalyticsLogger(context);
3029

31-
// Suggest installing the GraphQL syntax highlighter extension
32-
await suggestGraphqlSyntaxExtension();
3330

3431
await setupFirebasePath(analyticsLogger);
3532
const settings = getSettings();

firebase-vscode/src/test/default_wdio.conf.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,11 @@ export const config: WebdriverIO.Config = {
4141

4242
logLevel: "debug",
4343

44-
beforeTest: async function () {
45-
const workbench = await browser.getWorkbench();
46-
const notifications = new Notifications(workbench);
47-
await notifications.installRecommendedExtension({
48-
extensionId: "graphql.vscode-graphql-syntax",
49-
message: "It is recommended to install GraphQL: Syntax Highlighter",
44+
beforeTest: async function () {
45+
await browser.pause(3000); // give some time for extension dependencies to load their README page
46+
await browser.executeWorkbench((vscode) => {
47+
vscode.commands.executeCommand("workbench.action.closeAllEditors"); // close GCA home page
5048
});
51-
await browser.pause(3000); // temporary fix, since installing the GCA extension takes over the main page
5249
},
5350

5451
afterTest: async function (test) {

firebase-vscode/src/test/integration/fishfood/emulator.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,23 @@ firebaseSuite("Emulator", async function () {
3131
expect(current).toContain("dataconnect :9399");
3232

3333
// Test 1: clear data button
34+
console.log("Running test: clear data button");
3435
await sidebar.clearEmulatorData();
36+
3537
const text = await terminal.getTerminalText();
3638
expect(
3739
text.includes("Clearing data from Data Connect data sources"),
3840
).toBeTruthy();
3941

4042
// Test 2: export data button
43+
console.log("Running test: export button");
44+
4145
await sidebar.exportEmulatorData();
4246
const exportNotification = await notifications.getExportNotification();
4347
expect(exportNotification).toExist();
4448

4549
// Test 3: edit the schema to cause a migration error
50+
console.log("Running test: migration error");
4651
const editor = new EditorView(workbench);
4752
await editor.openFile(schemaPath);
4853

firebase-vscode/src/test/utils/page_objects/execution.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export class ExecutionPanel {
99
readonly history: HistoryView;
1010

1111
async open(): Promise<void> {
12+
await browser.keys("F1");
1213
await this.workbench.executeCommand(
1314
"data-connect-execution-configuration.focus",
1415
);

firebase-vscode/src/test/utils/page_objects/terminal.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ export class TerminalView {
66
private readonly bottomBar = this.workbench.getBottomBar();
77
async getTerminalText() {
88
const tv = await this.bottomBar.openTerminalView();
9-
return tv.getText();
9+
/**
10+
* SEE: https://github.com/webdriverio-community/wdio-vscode-service/blob/e4ef4d5a1da194e9a6195fad881733c3aa6720d8/src/pageobjects/workbench/Workbench.ts#L183
11+
* The code recognizes our webview, and chooses to send `F1` as an input instead of as a keystroke.
12+
*/
13+
await browser.keys("F1");
14+
return await tv.getText();
1015
}
1116
}

0 commit comments

Comments
 (0)