Skip to content

Commit 39e2663

Browse files
author
Guilherme Saraiva
committed
Fix ESLint and Spelling errors on E2E tests
This patch fixes the ESLint errors and spelling errors on all E2E tests Change-Id: I0184ebe4e2a1f0a12771473171fc2df915230d1e
1 parent 3e99e5f commit 39e2663

32 files changed

+363
-336
lines changed

gui/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ frontend/src/app-wrapper/windows/.cr
4545
frontend/src/app-wrapper/windows/mysql-shell-gui/bin
4646
frontend/src/app-wrapper/windows/mysql-shell-gui/obj
4747
frontend/src/app-wrapper/windows/packages
48-
package-lock.json
4948
frontend/src/tests/e2e/selenium
5049

5150
# Embedded Shell in Extension

gui/extension/cspell.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,25 @@
88
"charsets",
99
"chromedriver",
1010
"codicon",
11+
"countryinfo",
1112
"DBHOSTNAME",
1213
"DBPASSWORD",
1314
"DBPORT",
15+
"DBPORTX",
16+
"DBSHELLPASSWORD",
17+
"DBSHELLUSERNAME",
1418
"DBUSERNAME",
1519
"Deallocate",
20+
"dummyschema",
1621
"esnext",
1722
"extest",
23+
"exthost",
24+
"filelog",
1825
"flowtype",
1926
"IDBP",
2027
"informations",
2128
"innodb",
29+
"interactable",
2230
"ISAM",
2331
"Kubuntu",
2432
"lightbulb",
@@ -27,11 +35,14 @@
2735
"mixins",
2836
"mutator",
2937
"mutators",
38+
"mysqldbsystem",
3039
"mysqlrouter",
40+
"mysqlx",
3141
"nchar",
3242
"nohide",
3343
"nohover",
3444
"nvarchar",
45+
"OCID",
3546
"overscan",
3647
"pixi",
3748
"polyline",
@@ -55,6 +66,7 @@
5566
"submenu",
5667
"submodule",
5768
"subquery",
69+
"syncronize",
5870
"tabindex",
5971
"TABLENAME",
6072
"Tablespace",
@@ -74,6 +86,7 @@
7486
"vsix",
7587
"webviews",
7688
"whitespaces",
89+
"xpto",
7790
"ZEROFILL"
7891
],
7992
"ignoreWords": [

gui/extension/tests/e2e/lib/cmdExecutor.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export class CommandExecutor {
113113
}
114114
}, constants.wait5seconds, "Text area was not interactable");
115115

116-
await driver.wait(until.elementLocated(locator.suggestWidget.exists), constants.wait150MiliSeconds)
116+
await driver.wait(until.elementLocated(locator.suggestWidget.exists), constants.wait150MilliSeconds)
117117
.then(async () => {
118118
const textArea = await driver.findElement(locator.notebook.codeEditor.textArea);
119119
await textArea.sendKeys(Key.ESCAPE);
@@ -436,9 +436,9 @@ export class CommandExecutor {
436436
};
437437

438438
/**
439-
* Fethces the last result id that exists on the editor and updates the current object result id
439+
* Fetches the last result id that exists on the editor and updates the current object result id
440440
*/
441-
public syncronizeResultId = async (): Promise<void> => {
441+
public synchronizeResultId = async (): Promise<void> => {
442442
const lastEditorResults = await driver.wait(until
443443
.elementsLocated(locator.notebook.codeEditor.editor.result.exists),
444444
constants.wait5seconds, "Could not find any results for sync");
@@ -496,7 +496,7 @@ export class CommandExecutor {
496496
};
497497

498498
/**
499-
* Checks if the command is consideres as "Special". Special means the command is one of the following:
499+
* Checks if the command is considered as "Special". Special means the command is one of the following:
500500
* - \\js
501501
* - \\javascript
502502
* - \\ts
@@ -523,7 +523,7 @@ export class CommandExecutor {
523523

524524
/**
525525
* Returns the result block for an expected result id
526-
* When the nextId is undefined, the method will return the last existing comand result on the editor
526+
* When the nextId is undefined, the method will return the last existing command result on the editor
527527
* @param cmd The command
528528
* @param searchOnExistingId The next expected result id
529529
* @returns A promise resolving when the mouse cursor is placed at the desired spot
@@ -659,7 +659,7 @@ export class CommandExecutor {
659659

660660
try {
661661
await driver.wait(until.elementLocated(locator.notebook.codeEditor.editor.result.hasContent),
662-
constants.wait150MiliSeconds);
662+
constants.wait150MilliSeconds);
663663
} catch (e) {
664664
return undefined;
665665
}
@@ -807,7 +807,7 @@ export class CommandExecutor {
807807

808808
/**
809809
* Calculates and returns the next expected result id
810-
* If the lastResultId is undefined, it will fectch the last existing result id from the editor,
810+
* If the lastResultId is undefined, it will fetch the last existing result id from the editor,
811811
* and calculate the next one based on it
812812
* @param lastResultId The last known result id
813813
* @returns A promise resolving with the next result id

gui/extension/tests/e2e/lib/constants.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export const bastionUsername = process.env.OCI_BASTION_USERNAME;
4848
export const bastionPassword = process.env.OCI_BASTION_PASSWORD;
4949

5050
// TIMEOUTS
51-
export const wait150MiliSeconds = 150;
51+
export const wait150MilliSeconds = 150;
5252
export const wait1second = 1000;
5353
export const wait2seconds = 2000;
5454
export const wait3seconds = 3000;
@@ -132,7 +132,7 @@ export const browseRESTDocs = "Browse the MySQL REST Service Documentation";
132132
export const configureREST = "Configure Instance for MySQL REST Service Support";
133133
export const setCurrentDBSchema = "Set As Current Database Schema";
134134
export const dumpSchemaToDisk = "Dump Schema to Disk";
135-
export const dumpSchemaToDiskToServ = "Dump Schema to Disk for MySQL Database Service";
135+
export const dumpSchemaToDiskToService = "Dump Schema to Disk for MySQL Database Service";
136136
export const copyToClipboard = "Copy To Clipboard";
137137
export const copyToClipboardName = "Name";
138138
export const copyToClipboardStat = "CREATE Statement";
@@ -157,7 +157,7 @@ export const killRouters = "Kill Local MySQL Router Instances";
157157
export const editRESTService = "Edit REST Service...";
158158
export const setAsCurrentREST = "Set as Current REST Service";
159159
export const loadRESTSchemaFromJSON = "Load REST Schema From JSON File...";
160-
export const exportRESTSDK = "Export REST Service SDK Files ...";
160+
export const exportRestSdk = "Export REST Service SDK Files ...";
161161
export const addNewAuthApp = "Add New Authentication App";
162162
export const deleteRESTService = "Delete REST Service...";
163163
export const mrsServiceDocs = "MRS Service Documentation";
@@ -177,8 +177,8 @@ export const setCurrentCompartment = "Set as Current Compartment";
177177
export const viewDBSystemInfo = "View DB System Information";
178178
export const createConnWithBastion = "Create Connection with Bastion Service";
179179
export const startDBSystem = "Start the DB System";
180-
export const restartDBSytem = "Restart the DB System";
181-
export const stopDBSytem = "Stop the DB System";
180+
export const restartDBSystem = "Restart the DB System";
181+
export const stopDBSystem = "Stop the DB System";
182182
export const deleteDBSystem = "Delete the DB System";
183183
export const createRouterEndpoint = "Create MySQL Router Endpoint on new Compute Instance";
184184
export const openNewShellConsole = "Open New MySQL Shell Console";
@@ -200,7 +200,7 @@ export const deleteRESTUser = "Delete User";
200200

201201
export const checkNewTabAndWebView = "Check New Tab and WebView";
202202
export const checkNewTab = "Check New Tab";
203-
export const checkNotif = "Check Notification";
203+
export const checkNotification = "Check Notification";
204204
export const checkInput = "Check Input";
205205
export const checkWebViewDialog = "Check Dialog inside a webview";
206206
export const checkDialog = "Check Dialog";
@@ -246,7 +246,7 @@ export const dbConnectionSqliteCtxMenu = new Map([
246246
export const schemaCtxMenu = new Map([
247247
[setCurrentDBSchema, 1],
248248
[dumpSchemaToDisk, 2],
249-
[dumpSchemaToDiskToServ, 3],
249+
[dumpSchemaToDiskToService, 3],
250250
[copyToClipboard, 4],
251251
[copyToClipboardName, 0],
252252
[copyToClipboardStat, 1],
@@ -295,7 +295,7 @@ export const restServiceCtxMenu = new Map([
295295
[editRESTService, 1],
296296
[setAsCurrentREST, 2],
297297
[loadRESTSchemaFromJSON, 3],
298-
[exportRESTSDK, 4],
298+
[exportRestSdk, 4],
299299
[addNewAuthApp, 5],
300300
[deleteRESTService, 6],
301301
[mrsServiceDocs, 7],
@@ -345,8 +345,8 @@ export const ociDBSCtxMenu = new Map([
345345
[viewDBSystemInfo, 1],
346346
[createConnWithBastion, 2],
347347
[startDBSystem, 3],
348-
[restartDBSytem, 4],
349-
[stopDBSytem, 5],
348+
[restartDBSystem, 4],
349+
[stopDBSystem, 5],
350350
[deleteDBSystem, 6],
351351
[createRouterEndpoint, 7],
352352
]);

gui/extension/tests/e2e/lib/interfaces.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ export interface ICommandResultIdHolder {
225225
suite?: string;
226226
}
227227

228-
export interface IExportMRSSDK {
228+
export interface IExportMrsSdk {
229229
directory: string;
230230
url: string;
231231
apiLanguage: string;

gui/extension/tests/e2e/lib/locators.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ export const dbConnectionDialog = {
5151
mds: {
5252
profileNameList: By.id("profileNamePopup"),
5353
profileName: By.id("profileName"),
54-
dbDystemId: By.id("mysqlDbSystemId"),
55-
dbDystemName: By.id("mysqlDbSystemName"),
54+
dbSystemId: By.id("mysqlDbSystemId"),
55+
dbSystemName: By.id("mysqlDbSystemName"),
5656
bastionId: By.id("bastionId"),
5757
bastionName: By.id("bastionName"),
5858
},
@@ -201,7 +201,7 @@ export const mrsServiceDialog = {
201201
authCompletedUrlValidation: By.id("authCompletedUrlValidation"),
202202
authCompletedPageContent: By.id("authCompletedPageContent"),
203203
},
204-
autenticationAppsTab: By.id("page3"),
204+
authenticationAppsTab: By.id("page3"),
205205
authenticationApps: {
206206
vendorNameList: By.id("authApps.authVendorNamePopup"),
207207
vendorName: By.id("authApps.authVendorName"),
@@ -210,7 +210,7 @@ export const mrsServiceDialog = {
210210
authAppsId: By.id("authApps.appId"),
211211
authAppsAccessToken: By.id("authApps.accessToken"),
212212
authAppsUrl: By.id("authApps.url"),
213-
authAppsurlDirectAuth: By.id("authApps.urlDirectAuth"),
213+
authAppsUrlDirectAuth: By.id("authApps.urlDirectAuth"),
214214
},
215215
ok: By.id("ok"),
216216
cancel: By.id("cancel"),

gui/extension/tests/e2e/lib/misc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export class Misc {
9393
const iframe = await driver.findElements(locator.iframe.exists);
9494
if (iframe.length > 0) {
9595
await driver.wait(until.ableToSwitchToFrame(iframe[0]),
96-
constants.wait150MiliSeconds);
96+
constants.wait150MilliSeconds);
9797
}
9898

9999
return true;

gui/extension/tests/e2e/lib/os.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export class Os {
8989

9090
/**
9191
* Deletes all credentials for database access using shell
92-
* @returns A promise resolving when the credetials are deleted
92+
* @returns A promise resolving when the credentials are deleted
9393
*/
9494
public static deleteCredentials = async (): Promise<void> => {
9595
const params = ["--js", "-e", "shell.deleteAllCredentials()"];
@@ -113,7 +113,7 @@ export class Os {
113113
* Gets the extension output logs folder
114114
* @returns A promise resolving with the location of the logs folder
115115
*/
116-
public static getExtentionOutputLogsFolder = async (): Promise<string> => {
116+
public static getExtensionOutputLogsFolder = async (): Promise<string> => {
117117
let testResources: string;
118118
for (let i = 0; i <= process.argv.length - 1; i++) {
119119
if (process.argv[i] === "-s") {
@@ -168,7 +168,7 @@ export class Os {
168168
* @returns A promise resolving when the logs are prepared
169169
*/
170170
public static prepareExtensionLogsForExport = async (testSuite: string): Promise<void> => {
171-
const logPathFolder = await Os.getExtentionOutputLogsFolder();
171+
const logPathFolder = await Os.getExtensionOutputLogsFolder();
172172
try {
173173
// rename the file
174174
await fs.rename(join(logPathFolder, constants.feLogFile),

gui/extension/tests/e2e/lib/treeViews/section.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ export class Section {
159159
};
160160

161161
/**
162-
* Focus a section, by expanding the section and collapsing all the otehrs
162+
* Focus a section, by expanding the section and collapsing all the others
163163
* @param section The section
164164
* @returns A promise resolving when the section is focused
165165
*/
@@ -250,7 +250,7 @@ export class Section {
250250

251251
}), constants.wait5seconds, `${section} was not focused`);
252252
} else {
253-
throw new Error(`Unknow section: ${section}`);
253+
throw new Error(`Unknown section: ${section}`);
254254
}
255255
};
256256

@@ -294,7 +294,7 @@ export class Section {
294294
};
295295

296296
/**
297-
* Restarts MySQL Shell from the toolbar context mnenu
297+
* Restarts MySQL Shell from the toolbar context menu
298298
* @returns A promise resolving when MySQL Shell is restarted
299299
*/
300300
public static restartShell = async (): Promise<void> => {

gui/extension/tests/e2e/lib/treeViews/tree.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ export class Tree {
377377
};
378378

379379
/**
380-
* Gets the database connections from the DABATASE CONNECTIONS section
380+
* Gets the database connections from the DATABASE CONNECTIONS section
381381
* @returns A promise resolving with the database connections
382382
*/
383383
public static getDatabaseConnections = async (): Promise<interfaces.ITreeDBConnection[]> => {

gui/extension/tests/e2e/lib/until.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,13 @@ export const toolbarButtonIsEnabled = (button: string): Condition<boolean> => {
199199
};
200200

201201
export const resultTabIsMaximized = (): Condition<boolean> => {
202-
return new Condition(`for result tab to be maximezed`, async () => {
202+
return new Condition(`for result tab to be maximized`, async () => {
203203
return (await driver.findElements(locator.notebook.codeEditor.editor.result.status.normalize)).length > 0;
204204
});
205205
};
206206

207207
export const resultTabIsNormalized = (): Condition<boolean> => {
208-
return new Condition(`for result tab to be maximezed`, async () => {
208+
return new Condition(`for result tab to be maximized`, async () => {
209209
return (await driver.findElements(locator.notebook.codeEditor.editor.result.status.normalize)).length === 0;
210210
});
211211
};
@@ -221,7 +221,7 @@ export const editorHasNewPrompt = (): Condition<boolean> => {
221221

222222
export const notificationExists = (notification: string, dismiss = true,
223223
expectFailure = false): Condition<boolean> => {
224-
return new Condition(`for notication '${notification}' to be displayed`, async () => {
224+
return new Condition(`for notification '${notification}' to be displayed`, async () => {
225225
try {
226226
if (Misc.insideIframe) {
227227
await Misc.switchBackToTopFrame();
@@ -311,7 +311,7 @@ export const extensionIsReady = (): Condition<boolean> => {
311311

312312
const text = `Extension was not loaded successfully after ${feLoadTries} tries. Check the logs.`;
313313
// one last try to recover
314-
const path = join(await Os.getExtentionOutputLogsFolder(), constants.feLogFile);
314+
const path = join(await Os.getExtensionOutputLogsFolder(), constants.feLogFile);
315315
const output = (await fs.readFile(path)).toString();
316316
console.log("-----OUTPUT LOGS------");
317317
console.log(output);

gui/extension/tests/e2e/lib/webviews/dbConnection.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,10 @@ export class DatabaseConnection {
131131
await driver.wait(until.elementLocated(By.id(mds.profile)), constants.wait5seconds).click();
132132
}
133133
if (mds.dbSystemOCID) {
134-
await DialogHelper.setFieldText(dialog, locator.dbConnectionDialog.mysql.mds.dbDystemId,
134+
await DialogHelper.setFieldText(dialog, locator.dbConnectionDialog.mysql.mds.dbSystemId,
135135
mds.dbSystemOCID);
136136
await dialog.click();
137-
const dbSystemName = dialog.findElement(locator.dbConnectionDialog.mysql.mds.dbDystemName);
137+
const dbSystemName = dialog.findElement(locator.dbConnectionDialog.mysql.mds.dbSystemName);
138138
await driver.wait(new Condition("", async () => {
139139
return !(await dbSystemName.getAttribute("value")).includes("Loading");
140140
}), constants.wait10seconds, "DB System name is still loading");
@@ -223,11 +223,11 @@ export class DatabaseConnection {
223223
* @param schemas The schemas
224224
* @param opMode The operational mode
225225
* @param output The output
226-
* @param disableCols True to disable unsupported columnds, false otherwise
227-
* @param optimize True to optimze load parallelism, false otherwise
226+
* @param disableCols True to disable unsupported columns, false otherwise
227+
* @param optimize True to optimize load parallelism, false otherwise
228228
* @param enableMemory True to enable memory check, false otherwise
229229
* @param sqlMode The SQL mode
230-
* @param exludeList The exclude list
230+
* @param excludeList The exclude list
231231
* @returns A promise resolving when the schema data is set
232232
*/
233233
public static setDataToHeatWave = async (
@@ -238,7 +238,7 @@ export class DatabaseConnection {
238238
optimize?: boolean,
239239
enableMemory?: boolean,
240240
sqlMode?: string,
241-
exludeList?: string,
241+
excludeList?: string,
242242
): Promise<void> => {
243243

244244
if (!(await Misc.insideIframe())) {
@@ -284,9 +284,9 @@ export class DatabaseConnection {
284284
const sqlModeInput = await dialog.findElement(locator.hwDialog.sqlMode);
285285
await sqlModeInput.sendKeys(sqlMode);
286286
}
287-
if (exludeList) {
288-
const exludeListInput = await dialog.findElement(locator.hwDialog.excludeList);
289-
await exludeListInput.sendKeys(exludeList);
287+
if (excludeList) {
288+
const excludeListInput = await dialog.findElement(locator.hwDialog.excludeList);
289+
await excludeListInput.sendKeys(excludeList);
290290
}
291291

292292
await dialog.findElement(locator.hwDialog.ok).click();

0 commit comments

Comments
 (0)