@oracle/oraclejet-core-pack 17.0.5 → 17.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/oj-c/InputDateText.json +43 -43
- package/oj-c/action-card/component.json +2 -2
- package/oj-c/area-chart/component.json +2 -2
- package/oj-c/area-chart-group/component.json +2 -2
- package/oj-c/area-chart-item/component.json +2 -2
- package/oj-c/area-chart-series/component.json +2 -2
- package/oj-c/avatar/component.json +2 -2
- package/oj-c/button/component.json +2 -2
- package/oj-c/buttonset-multiple/component.json +2 -2
- package/oj-c/buttonset-single/component.json +2 -2
- package/oj-c/card-view/component.json +2 -2
- package/oj-c/checkbox/component.json +2 -2
- package/oj-c/checkboxset/component.json +2 -2
- package/oj-c/collapsible/component.json +2 -2
- package/oj-c/component.json +2 -2
- package/oj-c/conveyor-belt/component.json +2 -2
- package/oj-c/date-picker/component.json +2 -2
- package/oj-c/drag-handle/component.json +2 -2
- package/oj-c/drawer-layout/component.json +2 -2
- package/oj-c/drawer-popup/component.json +2 -2
- package/oj-c/file-picker/__webdriver__/FilePickerWebElement.js +20 -10
- package/oj-c/file-picker/__webdriver__/FilePickerWebElement.js.map +1 -1
- package/oj-c/file-picker/component.json +2 -2
- package/oj-c/form-layout/component.json +2 -2
- package/oj-c/highlight-text/component.json +2 -2
- package/oj-c/input-date-mask/component.json +2 -2
- package/oj-c/input-date-picker/component.json +2 -2
- package/oj-c/input-date-text/__webdriver__/InputDateTextWebElement.js +9 -11
- package/oj-c/input-date-text/__webdriver__/InputDateTextWebElement.js.map +1 -1
- package/oj-c/input-date-text/component.json +2 -2
- package/oj-c/input-month-mask/component.json +2 -2
- package/oj-c/input-number/__webdriver__/InputNumberWebElement.js +10 -12
- package/oj-c/input-number/__webdriver__/InputNumberWebElement.js.map +1 -1
- package/oj-c/input-number/component.json +2 -2
- package/oj-c/input-password/__webdriver__/InputPasswordWebElement.js +9 -11
- package/oj-c/input-password/__webdriver__/InputPasswordWebElement.js.map +1 -1
- package/oj-c/input-password/component.json +2 -2
- package/oj-c/input-sensitive-text/__webdriver__/InputSensitiveTextWebElement.js +16 -12
- package/oj-c/input-sensitive-text/__webdriver__/InputSensitiveTextWebElement.js.map +1 -1
- package/oj-c/input-sensitive-text/component.json +2 -2
- package/oj-c/input-text/__webdriver__/InputTextWebElement.js +10 -12
- package/oj-c/input-text/__webdriver__/InputTextWebElement.js.map +1 -1
- package/oj-c/input-text/component.json +2 -2
- package/oj-c/labelled-link/component.json +2 -2
- package/oj-c/legend/component.json +2 -2
- package/oj-c/legend-item/component.json +2 -2
- package/oj-c/legend-section/component.json +2 -2
- package/oj-c/line-chart/component.json +2 -2
- package/oj-c/line-chart-group/component.json +2 -2
- package/oj-c/line-chart-item/component.json +2 -2
- package/oj-c/line-chart-series/component.json +2 -2
- package/oj-c/list-item-layout/component.json +2 -2
- package/oj-c/list-view/component.json +2 -2
- package/oj-c/menu-button/component.json +2 -2
- package/oj-c/message-banner/component.json +2 -2
- package/oj-c/message-toast/component.json +2 -2
- package/oj-c/metadata/allComponents.json +123 -123
- package/oj-c/meter-bar/component.json +2 -2
- package/oj-c/meter-circle/component.json +2 -2
- package/oj-c/popup/component.json +2 -2
- package/oj-c/progress-bar/component.json +2 -2
- package/oj-c/progress-circle/component.json +2 -2
- package/oj-c/radioset/component.json +2 -2
- package/oj-c/rating-gauge/component.json +2 -2
- package/oj-c/select-multiple/component.json +2 -2
- package/oj-c/select-single/component.json +2 -2
- package/oj-c/selection-card/component.json +2 -2
- package/oj-c/selector/component.json +2 -2
- package/oj-c/selector-all/component.json +2 -2
- package/oj-c/split-menu-button/component.json +2 -2
- package/oj-c/tab-bar/component.json +2 -2
- package/oj-c/tab-bar-mixed/component.json +2 -2
- package/oj-c/tag-cloud/component.json +2 -2
- package/oj-c/tag-cloud-item/component.json +2 -2
- package/oj-c/text-area/__webdriver__/TextAreaWebElement.js +10 -12
- package/oj-c/text-area/__webdriver__/TextAreaWebElement.js.map +1 -1
- package/oj-c/text-area/component.json +2 -2
- package/oj-c/toggle-button/component.json +2 -2
- package/package.json +4 -4
|
@@ -5,6 +5,8 @@ var FilePickerWebElementBase_1 = require("./FilePickerWebElementBase");
|
|
|
5
5
|
var fs = require("fs");
|
|
6
6
|
var path = require("path");
|
|
7
7
|
var busy_context_utils_1 = require("@oracle/oraclejet-webdriver/lib/busy-context-utils");
|
|
8
|
+
const filestoreName = '__oj_filepicker_files';
|
|
9
|
+
const filenamePrefix = 'file_';
|
|
8
10
|
/**
|
|
9
11
|
* The component WebElement for [oj-c-file-picker](../../../oj-c/docs/oj.FilePicker.html).
|
|
10
12
|
* Do not instantiate this class directly, instead, use
|
|
@@ -70,28 +72,36 @@ class FilePickerWebElement extends FilePickerWebElementBase_1.FilePickerWebEleme
|
|
|
70
72
|
fileNumber: i
|
|
71
73
|
};
|
|
72
74
|
await driver.executeScript(`const file = arguments[0];
|
|
75
|
+
const filestoreName = arguments[1];
|
|
76
|
+
const filenamePrefix = arguments[2];
|
|
77
|
+
const filestore = window[filestoreName] = window[filestoreName] || {};
|
|
73
78
|
const chunkNumber = file.chunkNumber;
|
|
74
|
-
|
|
79
|
+
const data = {
|
|
75
80
|
bytes: file.bytes,
|
|
76
81
|
path: file.path,
|
|
77
82
|
type: file.type
|
|
78
83
|
}
|
|
84
|
+
const fileKey = filenamePrefix + file.fileNumber;
|
|
79
85
|
if (chunkNumber == 0) {
|
|
80
|
-
|
|
86
|
+
filestore[fileKey] = [data];
|
|
81
87
|
} else {
|
|
82
|
-
|
|
83
|
-
}`, file);
|
|
88
|
+
filestore[fileKey].push(data);
|
|
89
|
+
}`, file, filestoreName, filenamePrefix);
|
|
84
90
|
}
|
|
85
91
|
}
|
|
86
92
|
driver.executeScript(`const numFiles = arguments[0];
|
|
93
|
+
const filestoreName = arguments[1];
|
|
94
|
+
const filenamePrefix = arguments[2];
|
|
95
|
+
const filestore = window[filestoreName];
|
|
87
96
|
const list = [];
|
|
88
97
|
for ( let i = 0; i < numFiles; i++) {
|
|
89
|
-
const
|
|
90
|
-
|
|
98
|
+
const fileKey = filenamePrefix + i;
|
|
99
|
+
const chunks = filestore[fileKey];
|
|
100
|
+
delete filestore[fileKey];
|
|
91
101
|
list.push({
|
|
92
|
-
bytes:
|
|
93
|
-
path:
|
|
94
|
-
type:
|
|
102
|
+
bytes: chunks.reduce((acc, chunk) => acc.concat(chunk.bytes), []),
|
|
103
|
+
path: chunks[0].path,
|
|
104
|
+
type: chunks[0].type
|
|
95
105
|
});
|
|
96
106
|
}
|
|
97
107
|
const fileList = list.map((data) => {
|
|
@@ -110,7 +120,7 @@ class FilePickerWebElement extends FilePickerWebElementBase_1.FilePickerWebEleme
|
|
|
110
120
|
}
|
|
111
121
|
}
|
|
112
122
|
HTMLInputElement.prototype._pickerTestData = fileList;
|
|
113
|
-
`, dataList.length);
|
|
123
|
+
`, dataList.length, filestoreName, filenamePrefix);
|
|
114
124
|
}
|
|
115
125
|
}
|
|
116
126
|
exports.FilePickerWebElement = FilePickerWebElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilePickerWebElement.js","sourceRoot":"","sources":["FilePickerWebElement.ts"],"names":[],"mappings":";;;AAAA,uEAAsE;AACtE,uBAAyB;AACzB,2BAA6B;AAE7B,yFAA0F;AAE1F;;;;GAIG;AACH,MAAa,oBAAqB,SAAQ,mDAAwB;IAChE;;;;;;;OAOG;IACH,KAAK,CAAC,QAAQ,CAAC,KAA4C;QACzD,MAAM,oBAAoB,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,KAAK,CAAC,CAAC;QAEnE,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC,aAAa,CAAC,kCAAkC,EAAE,IAAI,CAAC,CAAC;QAE/E,MAAM,IAAI,CAAC,oBAAoB,EAAE,CAAC;IACpC,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,MAAiB,EAAE,KAA4C;QACzF,MAAM,I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AE,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;YACxD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBACtC,MAAM,IAAI,GAAG;oBACX,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;oBACf,IAAI;oBACJ,IAAI;oBACJ,YAAY;oBACZ,WAAW,EAAE,CAAC;oBACd,UAAU,EAAE,CAAC;iBACd,CAAC;gBACF,MAAM,MAAM,CAAC,aAAa,CACxB;;;;;;;;;;;;;;;aAeG,EACH,IAAI,EACJ,aAAa,EACb,cAAc,CACf,CAAC;YACJ,CAAC;QACH,CAAC;QAED,MAAM,CAAC,aAAa,CAClB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA+BE,EACF,QAAQ,CAAC,MAAM,EACf,aAAa,EACb,cAAc,CACf,CAAC;IACJ,CAAC;CACF;AA7HD,oDA6HC","sourcesContent":["import { FilePickerWebElementBase } from './FilePickerWebElementBase';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { WebDriver } from 'selenium-webdriver';\nimport { whenBusyContextReady } from '@oracle/oraclejet-webdriver/lib/busy-context-utils';\n\nconst filestoreName = '__oj_filepicker_files';\nconst filenamePrefix = 'file_';\n\n/**\n * The component WebElement for [oj-c-file-picker](../../../oj-c/docs/oj.FilePicker.html).\n * Do not instantiate this class directly, instead, use\n * [findFilePicker](../functions/findFilePicker.html).\n */\nexport class FilePickerWebElement extends FilePickerWebElementBase {\n /**\n * Takes an Array of objects containing file paths + types.\n * These files will be read from the local filesystem and then sent\n * to the oj-file-picker to simulate user file selection. Only the basename of\n * the file will be sent, not the entire path to make it consistent with how\n * the browser sets the value.\n * @param files An array of objects containing the path and type of selected files\n */\n async doSelect(files: Array<{ path: string; type: string }>) {\n await FilePickerWebElement.setupPickFiles(this.getDriver(), files);\n\n await this.getDriver().executeScript(`arguments[0].firstChild.click();`, this);\n\n await this.whenBusyContextReady();\n }\n\n /**\n * This method should be called right before ojfilepickerutils.pickFiles\n * Takes the webdriver and an Array of objects containing file paths + types.\n * These files will be read from the local filesystem and then sent\n * to the pickFiles method to simulate user file selection. Only the basename of\n * the file will be sent, not the entire path to make it consistent with how\n * the browser sets the value.\n * @param driver the Webdriver of the test\n * @param files An array of objects containing the path and type of selected files\n */\n static async setupPickFiles(driver: WebDriver, files: Array<{ path: string; type: string }>) {\n await whenBusyContextReady(driver);\n //create a buffer with the files\n const dataList = files.map(({ path: filePath, type }) => {\n const fileSizeInMB = fs.statSync(filePath).size / (1024 * 1024);\n const numberChunks = Math.ceil(fileSizeInMB / 8);\n const fileContent = Array.from(fs.readFileSync(filePath));\n const chunkSize = Math.floor(fileContent.length / numberChunks);\n const fileChunks = [];\n for (let i = 0; i < numberChunks; i++) {\n if (i + 1 == numberChunks) {\n fileChunks.push(fileContent.slice(i * chunkSize));\n } else {\n fileChunks.push(fileContent.slice(i * chunkSize, (i + 1) * chunkSize));\n }\n }\n\n return {\n bytes: fileChunks, //split it into 8MB chunks\n path: path.basename(filePath),\n type,\n numberChunks\n };\n });\n\n for (let i = 0; i < dataList.length; i++) {\n const { bytes, path, type, numberChunks } = dataList[i];\n for (let j = 0; j < bytes.length; j++) {\n const file = {\n bytes: bytes[j],\n path,\n type,\n numberChunks,\n chunkNumber: j,\n fileNumber: i\n };\n await driver.executeScript(\n `const file = arguments[0];\n const filestoreName = arguments[1];\n const filenamePrefix = arguments[2];\n const filestore = window[filestoreName] = window[filestoreName] || {};\n const chunkNumber = file.chunkNumber;\n const data = {\n bytes: file.bytes,\n path: file.path,\n type: file.type\n }\n const fileKey = filenamePrefix + file.fileNumber;\n if (chunkNumber == 0) {\n filestore[fileKey] = [data];\n } else {\n filestore[fileKey].push(data);\n }`,\n file,\n filestoreName,\n filenamePrefix\n );\n }\n }\n\n driver.executeScript(\n `const numFiles = arguments[0];\n const filestoreName = arguments[1];\n const filenamePrefix = arguments[2];\n const filestore = window[filestoreName];\n const list = [];\n for ( let i = 0; i < numFiles; i++) {\n const fileKey = filenamePrefix + i;\n const chunks = filestore[fileKey];\n delete filestore[fileKey];\n list.push({\n bytes: chunks.reduce((acc, chunk) => acc.concat(chunk.bytes), []),\n path: chunks[0].path,\n type: chunks[0].type\n });\n }\n const fileList = list.map((data) => {\n return new File([Uint8Array.from(data.bytes)], data.path, {type: data.type});\n })\n // Only if setupPickFiles has not been called yet\n if (!HTMLInputElement.prototype._pickerTestData) {\n //Save the native click method\n const clickMethod = HTMLInputElement.prototype.click;\n //Overwrite the click method\n HTMLInputElement.prototype.click = function() {\n const event = new CustomEvent(\"change\");\n this.dispatchEvent(event);\n delete HTMLInputElement.prototype._pickerTestData;\n HTMLInputElement.prototype.click = clickMethod;\n }\n }\n HTMLInputElement.prototype._pickerTestData = fileList;\n `,\n dataList.length,\n filestoreName,\n filenamePrefix\n );\n }\n}\n"]}
|
|
@@ -19,18 +19,16 @@ class InputDateTextWebElement extends InputDateTextWebElementBase_1.InputDateTex
|
|
|
19
19
|
const disabled = await this.getDisabled();
|
|
20
20
|
if (!(disabled || readonly)) {
|
|
21
21
|
await this.whenBusyContextReady();
|
|
22
|
-
// Note that using element.clear() will blur, which commits the change and
|
|
23
|
-
//
|
|
24
|
-
// Instead
|
|
25
|
-
// in a new value. We mock committing the value by calling validate().
|
|
26
|
-
let currValue = await this.getProperty('rawValue');
|
|
27
|
-
while (currValue) {
|
|
28
|
-
const backspaces = new Array(currValue.length + 1).join(selenium_webdriver_1.Key.BACK_SPACE);
|
|
29
|
-
// First move the cursor to the end, then backspaces.
|
|
30
|
-
await this.sendKeys([selenium_webdriver_1.Key.END, backspaces].join(''));
|
|
31
|
-
currValue = await this.getProperty('rawValue');
|
|
32
|
-
}
|
|
22
|
+
// Note that using element.clear() will blur, which commits the change and calls
|
|
23
|
+
// onValueChanged, which we don't want until we're done updating the value.
|
|
24
|
+
// Instead do select-all, then delete to clear the value.
|
|
33
25
|
const input = await this.findElement(selenium_webdriver_1.By.css('input'));
|
|
26
|
+
const currValue = await this.getRawValue();
|
|
27
|
+
if (currValue) {
|
|
28
|
+
const platform = await (await this.getDriver().getCapabilities()).getPlatform();
|
|
29
|
+
await input.sendKeys(platform === 'mac' ? selenium_webdriver_1.Key.COMMAND : selenium_webdriver_1.Key.CONTROL, 'a');
|
|
30
|
+
await input.sendKeys(selenium_webdriver_1.Key.DELETE);
|
|
31
|
+
}
|
|
34
32
|
value && (await input.sendKeys(value));
|
|
35
33
|
return this.getDriver().executeAsyncScript(`
|
|
36
34
|
let el = arguments[0];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputDateTextWebElement.js","sourceRoot":"","sources":["InputDateTextWebElement.ts"],"names":[],"mappings":";;;AAAA,6EAA4E;AAC5E,yDAA6C;AAE7C;;;;GAIG;AACH,MAAa,uBAAwB,SAAQ,yDAA2B;IACtE;;;OAGG;IACI,KAAK,CAAC,WAAW,CAAC,KAAoB;QAC3C,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC,aAAa,CAAC,sBAAsB,EAAE,IAAI,CAAC,CAAC;QACnE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QAC1C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QAC1C,IAAI,CAAC,CAAC,QAAQ,IAAI,QAAQ,CAAC,EAAE,CAAC;YAC5B,MAAM,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAElC,
|
|
1
|
+
{"version":3,"file":"InputDateTextWebElement.js","sourceRoot":"","sources":["InputDateTextWebElement.ts"],"names":[],"mappings":";;;AAAA,6EAA4E;AAC5E,yDAA6C;AAE7C;;;;GAIG;AACH,MAAa,uBAAwB,SAAQ,yDAA2B;IACtE;;;OAGG;IACI,KAAK,CAAC,WAAW,CAAC,KAAoB;QAC3C,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC,aAAa,CAAC,sBAAsB,EAAE,IAAI,CAAC,CAAC;QACnE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QAC1C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QAC1C,IAAI,CAAC,CAAC,QAAQ,IAAI,QAAQ,CAAC,EAAE,CAAC;YAC5B,MAAM,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAElC,gFAAgF;YAChF,2EAA2E;YAC3E,yDAAyD;YACzD,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,uBAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;YACtD,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;YAC3C,IAAI,SAAS,EAAE,CAAC;gBACd,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC,eAAe,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;gBAChF,MAAM,KAAK,CAAC,QAAQ,CAAC,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC,wBAAG,CAAC,OAAO,CAAC,CAAC,CAAC,wBAAG,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;gBAC1E,MAAM,KAAK,CAAC,QAAQ,CAAC,wBAAG,CAAC,MAAM,CAAC,CAAC;YACnC,CAAC;YACD,KAAK,IAAI,CAAC,MAAM,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;YAEvC,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC,kBAAkB,CACxC;;;;OAID,EACC,IAAI,CACL,CAAC;QACJ,CAAC;IACH,CAAC;IAED;;OAEG;IACH,KAAK;QACH,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;CACF;AAzCD,0DAyCC","sourcesContent":["import { InputDateTextWebElementBase } from './InputDateTextWebElementBase';\nimport { By, Key } from 'selenium-webdriver';\n\n/**\n * The component WebElement for [oj-c-input-date-text](../../../oj-c/docs/oj.InputDateText.html).\n * Do not instantiate this class directly, instead, use\n * [findInputDateText](../functions/findInputDateText.html).\n */\nexport class InputDateTextWebElement extends InputDateTextWebElementBase {\n /**\n * Sets the value of the \"value\" property of the input component.\n * @param value The value to set for the <code>value</code>\n */\n public async changeValue(value: string | null): Promise<void> {\n await this.getDriver().executeScript('arguments[0].focus()', this);\n const readonly = await this.getReadonly();\n const disabled = await this.getDisabled();\n if (!(disabled || readonly)) {\n await this.whenBusyContextReady();\n\n // Note that using element.clear() will blur, which commits the change and calls\n // onValueChanged, which we don't want until we're done updating the value.\n // Instead do select-all, then delete to clear the value.\n const input = await this.findElement(By.css('input'));\n const currValue = await this.getRawValue();\n if (currValue) {\n const platform = await (await this.getDriver().getCapabilities()).getPlatform();\n await input.sendKeys(platform === 'mac' ? Key.COMMAND : Key.CONTROL, 'a');\n await input.sendKeys(Key.DELETE);\n }\n value && (await input.sendKeys(value));\n\n return this.getDriver().executeAsyncScript(\n `\n let el = arguments[0];\n let done = arguments[1];\n el.validate().then(done).catch(done);\n `,\n this\n );\n }\n }\n\n /**\n * Clears the value of the component.\n */\n clear(): Promise<void> {\n return this.changeValue(null);\n }\n}\n"]}
|
|
@@ -19,19 +19,17 @@ class InputNumberWebElement extends InputNumberWebElementBase_1.InputNumberWebEl
|
|
|
19
19
|
const disabled = await this.getDisabled();
|
|
20
20
|
if (!(disabled || readonly)) {
|
|
21
21
|
await this.whenBusyContextReady();
|
|
22
|
-
// Note that using element.clear() will blur, which commits the change and
|
|
23
|
-
//
|
|
24
|
-
// Instead
|
|
25
|
-
// in a new value. We mock committing the value by calling validate().
|
|
26
|
-
let currValue = await this.getProperty('rawValue');
|
|
27
|
-
while (currValue) {
|
|
28
|
-
const backspaces = new Array(currValue.length + 1).join(selenium_webdriver_1.Key.BACK_SPACE);
|
|
29
|
-
// First move the cursor to the end, then backspaces.
|
|
30
|
-
await this.sendKeys([selenium_webdriver_1.Key.END, backspaces].join(''));
|
|
31
|
-
currValue = await this.getProperty('rawValue');
|
|
32
|
-
}
|
|
22
|
+
// Note that using element.clear() will blur, which commits the change and calls
|
|
23
|
+
// onValueChanged, which we don't want until we're done updating the value.
|
|
24
|
+
// Instead do select-all, then delete to clear the value.
|
|
33
25
|
const input = await this.findElement(selenium_webdriver_1.By.css('input'));
|
|
34
|
-
|
|
26
|
+
const currValue = await this.getRawValue();
|
|
27
|
+
if (currValue) {
|
|
28
|
+
const platform = await (await this.getDriver().getCapabilities()).getPlatform();
|
|
29
|
+
await input.sendKeys(platform === 'mac' ? selenium_webdriver_1.Key.COMMAND : selenium_webdriver_1.Key.CONTROL, 'a');
|
|
30
|
+
await input.sendKeys(selenium_webdriver_1.Key.DELETE);
|
|
31
|
+
}
|
|
32
|
+
value !== null && (await input.sendKeys(value));
|
|
35
33
|
return this.getDriver().executeAsyncScript(`
|
|
36
34
|
let el = arguments[0];
|
|
37
35
|
let done = arguments[1];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputNumberWebElement.js","sourceRoot":"","sources":["InputNumberWebElement.ts"],"names":[],"mappings":";;;AAAA,yEAAwE;AACxE,yDAA6C;AAE7C;;;;GAIG;AACH,MAAa,qBAAsB,SAAQ,qDAAyB;IAClE;;;OAGG;IACI,KAAK,CAAC,WAAW,CAAC,KAAoB;QAC3C,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC,aAAa,CAAC,sBAAsB,EAAE,IAAI,CAAC,CAAC;QACnE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QAC1C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QAC1C,IAAI,CAAC,CAAC,QAAQ,IAAI,QAAQ,CAAC,EAAE,CAAC;YAC5B,MAAM,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAElC,
|
|
1
|
+
{"version":3,"file":"InputNumberWebElement.js","sourceRoot":"","sources":["InputNumberWebElement.ts"],"names":[],"mappings":";;;AAAA,yEAAw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AC;IAED;;OAEG;IACH,KAAK;QACH,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;CACF;AAzCD,sDAyCC","sourcesContent":["import { InputNumberWebElementBase } from './InputNumberWebElementBase';\nimport { By, Key } from 'selenium-webdriver';\n\n/**\n * The component WebElement for [oj-c-input-number](../../../oj-c/docs/oj.InputNumber.html).\n * Do not instantiate this class directly, instead, use\n * [findInputNumber](../functions/findInputNumber.html).\n */\nexport class InputNumberWebElement extends InputNumberWebElementBase {\n /**\n * Sets the value of the \"value\" property of the input component.\n * @param value The value to set for the <code>value</code>\n */\n public async changeValue(value: number | null): Promise<void> {\n await this.getDriver().executeScript('arguments[0].focus()', this);\n const readonly = await this.getReadonly();\n const disabled = await this.getDisabled();\n if (!(disabled || readonly)) {\n await this.whenBusyContextReady();\n\n // Note that using element.clear() will blur, which commits the change and calls\n // onValueChanged, which we don't want until we're done updating the value.\n // Instead do select-all, then delete to clear the value.\n const input = await this.findElement(By.css('input'));\n const currValue = await this.getRawValue();\n if (currValue) {\n const platform = await (await this.getDriver().getCapabilities()).getPlatform();\n await input.sendKeys(platform === 'mac' ? Key.COMMAND : Key.CONTROL, 'a');\n await input.sendKeys(Key.DELETE);\n }\n value !== null && (await input.sendKeys(value));\n\n return this.getDriver().executeAsyncScript(\n `\n let el = arguments[0];\n let done = arguments[1];\n el.validate().then(done).catch(done);\n `,\n this\n );\n }\n }\n\n /**\n * Clears the value of the component.\n */\n clear(): Promise<void> {\n return this.changeValue(null);\n }\n}\n"]}
|
|
@@ -19,18 +19,16 @@ class InputPasswordWebElement extends InputPasswordWebElementBase_1.InputPasswor
|
|
|
19
19
|
const disabled = await this.getDisabled();
|
|
20
20
|
if (!(disabled || readonly)) {
|
|
21
21
|
await this.whenBusyContextReady();
|
|
22
|
-
// Note that using element.clear() will blur, which commits the change and
|
|
23
|
-
//
|
|
24
|
-
// Instead
|
|
25
|
-
// in a new value. We mock committing the value by calling validate().
|
|
26
|
-
let currValue = await this.getProperty('rawValue');
|
|
27
|
-
while (currValue) {
|
|
28
|
-
const backspaces = new Array(currValue.length + 1).join(selenium_webdriver_1.Key.BACK_SPACE);
|
|
29
|
-
// First move the cursor to the end, then backspaces.
|
|
30
|
-
await this.sendKeys([selenium_webdriver_1.Key.END, backspaces].join(''));
|
|
31
|
-
currValue = await this.getProperty('rawValue');
|
|
32
|
-
}
|
|
22
|
+
// Note that using element.clear() will blur, which commits the change and calls
|
|
23
|
+
// onValueChanged, which we don't want until we're done updating the value.
|
|
24
|
+
// Instead do select-all, then delete to clear the value.
|
|
33
25
|
const input = await this.findElement(selenium_webdriver_1.By.css('input'));
|
|
26
|
+
const currValue = await this.getRawValue();
|
|
27
|
+
if (currValue) {
|
|
28
|
+
const platform = await (await this.getDriver().getCapabilities()).getPlatform();
|
|
29
|
+
await input.sendKeys(platform === 'mac' ? selenium_webdriver_1.Key.COMMAND : selenium_webdriver_1.Key.CONTROL, 'a');
|
|
30
|
+
await input.sendKeys(selenium_webdriver_1.Key.DELETE);
|
|
31
|
+
}
|
|
34
32
|
value && (await input.sendKeys(value));
|
|
35
33
|
return this.getDriver().executeAsyncScript(`
|
|
36
34
|
let el = arguments[0];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputPasswordWebElement.js","sourceRoot":"","sources":["InputPasswordWebElement.ts"],"names":[],"mappings":";;;AAAA,6EAA4E;AAC5E,yDAA6C;AAE7C;;;;GAIG;AACH,MAAa,uBAAwB,SAAQ,yDAA2B;IACtE;;;OAGG;IACI,KAAK,CAAC,WAAW,CAAC,KAAoB;QAC3C,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC,aAAa,CAAC,sBAAsB,EAAE,IAAI,CAAC,CAAC;QACnE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QAC1C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QAC1C,IAAI,CAAC,CAAC,QAAQ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K,IAAI,CAAC,MAAM,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;YAEvC,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC,kBAAkB,CACxC;;;;OAID,EACC,IAAI,CACL,CAAC;QACJ,CAAC;IACH,CAAC;IAED;;OAEG;IACH,KAAK;QACH,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;CACF;AA1CD,0DA0CC","sourcesContent":["import { InputPasswordWebElementBase } from './InputPasswordWebElementBase';\nimport { By, Key } from 'selenium-webdriver';\n\n/**\n * The component WebElement for [oj-c-input-password](../../../oj-c/docs/oj.InputPassword.html).\n * Do not instantiate this class directly, instead, use\n * [findInputPassword](../functions/findInputPassword.html).\n */\nexport class InputPasswordWebElement extends InputPasswordWebElementBase {\n /**\n * Sets the value of the \"value\" property of the input component.\n * @param value The value to set for the <code>value</code>\n */\n public async changeValue(value: string | null): Promise<void> {\n await this.getDriver().executeScript('arguments[0].focus()', this);\n const readonly = await this.getReadonly();\n const disabled = await this.getDisabled();\n if (!(disabled || readonly)) {\n await this.whenBusyContextReady();\n\n // Note that using element.clear() will blur, which commits the change and calls\n // onValueChanged, which we don't want until we're done updating the value.\n // Instead do select-all, then delete to clear the value.\n const input = await this.findElement(By.css('input'));\n const currValue = await this.getRawValue();\n if (currValue) {\n const platform = await (await this.getDriver().getCapabilities()).getPlatform();\n await input.sendKeys(platform === 'mac' ? Key.COMMAND : Key.CONTROL, 'a');\n await input.sendKeys(Key.DELETE);\n }\n\n value && (await input.sendKeys(value));\n\n return this.getDriver().executeAsyncScript(\n `\n let el = arguments[0];\n let done = arguments[1];\n el.validate().then(done).catch(done);\n `,\n this\n );\n }\n }\n\n /**\n * Clears the value of the component.\n */\n clear(): Promise<void> {\n return this.changeValue(null);\n }\n}\n"]}
|
|
@@ -19,19 +19,23 @@ class InputSensitiveTextWebElement extends InputSensitiveTextWebElementBase_1.In
|
|
|
19
19
|
const disabled = await this.getDisabled();
|
|
20
20
|
if (!(disabled || readonly)) {
|
|
21
21
|
await this.whenBusyContextReady();
|
|
22
|
-
// Note that using element.clear() will blur, which commits the change and
|
|
23
|
-
//
|
|
24
|
-
// Instead
|
|
25
|
-
// in a new value. We mock committing the value by calling validate().
|
|
26
|
-
let currValue = await this.getProperty('rawValue');
|
|
27
|
-
while (currValue) {
|
|
28
|
-
const backspaces = new Array(currValue.length + 1).join(selenium_webdriver_1.Key.BACK_SPACE);
|
|
29
|
-
// First move the cursor to the end, then backspaces.
|
|
30
|
-
await this.sendKeys([selenium_webdriver_1.Key.END, backspaces].join(''));
|
|
31
|
-
currValue = await this.getProperty('rawValue');
|
|
32
|
-
}
|
|
22
|
+
// Note that using element.clear() will blur, which commits the change and calls
|
|
23
|
+
// onValueChanged, which we don't want until we're done updating the value.
|
|
24
|
+
// Instead do select-all, then delete to clear the value.
|
|
33
25
|
const input = await this.findElement(selenium_webdriver_1.By.css('input'));
|
|
34
|
-
|
|
26
|
+
const currValue = await this.getRawValue();
|
|
27
|
+
if (currValue) {
|
|
28
|
+
const platform = await (await this.getDriver().getCapabilities()).getPlatform();
|
|
29
|
+
await input.sendKeys(platform === 'mac' ? selenium_webdriver_1.Key.COMMAND : selenium_webdriver_1.Key.CONTROL, 'a');
|
|
30
|
+
await input.sendKeys(selenium_webdriver_1.Key.DELETE);
|
|
31
|
+
}
|
|
32
|
+
// Regular sendKeys does not work with InputSensitiveText, so we use the action
|
|
33
|
+
// framework instead. This uses the native gestures framework of the drivers
|
|
34
|
+
// and simulates keyboard entry. Note: actions.sendKeys doesn't target a specific
|
|
35
|
+
// element - it just sends keys to the browser as though the user were to type it.
|
|
36
|
+
// The input must have focus for it to work (which we already do earlier).
|
|
37
|
+
const actions = this.getDriver().actions();
|
|
38
|
+
value && (await actions.sendKeys(value).perform());
|
|
35
39
|
return this.getDriver().executeAsyncScript(`
|
|
36
40
|
let el = arguments[0];
|
|
37
41
|
let done = arguments[1];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputSensitiveTextWebElement.js","sourceRoot":"","sources":["InputSensitiveTextWebElement.ts"],"names":[],"mappings":";;;AAAA,uFAAsF;AACtF,yDAA6C;AAE7C;;;;GAIG;AACH,MAAa,4BAA6B,SAAQ,mEAAgC;IAChF;;;OAGG;IACI,KAAK,CAAC,WAAW,CAAC,KAAoB;QAC3C,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC,aAAa,CAAC,sBAAsB,EAAE,IAAI,CAAC,CAAC;QACnE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QAC1C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QAC1C,IAAI,CAAC,CAAC,QAAQ,IAAI,QAAQ,CAAC,EAAE,CAAC;YAC5B,MAAM,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAElC,
|
|
1
|
+
{"version":3,"file":"InputSensitiveTextWebElement.js","sourceRoot":"","sources":["InputSensitiveTextWebElement.ts"],"names":[],"mappings":";;;AAAA,uFAAsF;AACtF,yDAA6C;AAE7C;;;;GAIG;AACH,MAAa,4BAA6B,SAAQ,mEAAgC;IAChF;;;OAGG;IACI,KAAK,CAAC,WAAW,CAAC,KAAoB;QAC3C,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC,aAAa,CAAC,sBAAsB,EAAE,IAAI,CAAC,CAAC;QACnE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QAC1C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QAC1C,IAAI,CAAC,CAAC,QAAQ,IAAI,QAAQ,CAAC,EAAE,CAAC;YAC5B,MAAM,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAElC,gFAAgF;YAChF,2EAA2E;YAC3E,yDAAyD;YACzD,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,uBAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;YACtD,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;YAC3C,IAAI,SAAS,EAAE,CAAC;gBACd,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC,eAAe,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;gBAChF,MAAM,KAAK,CAAC,QAAQ,CAAC,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC,wBAAG,CAAC,OAAO,CAAC,CAAC,CAAC,wBAAG,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;gBAC1E,MAAM,KAAK,CAAC,QAAQ,CAAC,wBAAG,CAAC,MAAM,CAAC,CAAC;YACnC,CAAC;YAED,+EAA+E;YAC/E,4EAA4E;YAC5E,iFAAiF;YACjF,kFAAkF;YAClF,0EAA0E;YAC1E,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,CAAC;YAC3C,KAAK,IAAI,CAAC,MAAM,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;YAEnD,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC,kBAAkB,CACxC;;;;OAID,EACC,IAAI,CACL,CAAC;QACJ,CAAC;IACH,CAAC;IAED;;OAEG;IACH,KAAK;QACH,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;CACF;AAhDD,oEAgDC","sourcesContent":["import { InputSensitiveTextWebElementBase } from './InputSensitiveTextWebElementBase';\nimport { By, Key } from 'selenium-webdriver';\n\n/**\n * The component WebElement for [oj-c-input-sensitive-text](../../../oj-c/docs/oj.InputSensitiveText.html).\n * Do not instantiate this class directly, instead, use\n * [findInputSensitiveText](../functions/findInputSensitiveText.html).\n */\nexport class InputSensitiveTextWebElement extends InputSensitiveTextWebElementBase {\n /**\n * Sets the value of the \"value\" property of the input component.\n * @param value The value to set for the <code>value</code>\n */\n public async changeValue(value: string | null): Promise<void> {\n await this.getDriver().executeScript('arguments[0].focus()', this);\n const readonly = await this.getReadonly();\n const disabled = await this.getDisabled();\n if (!(disabled || readonly)) {\n await this.whenBusyContextReady();\n\n // Note that using element.clear() will blur, which commits the change and calls\n // onValueChanged, which we don't want until we're done updating the value.\n // Instead do select-all, then delete to clear the value.\n const input = await this.findElement(By.css('input'));\n const currValue = await this.getRawValue();\n if (currValue) {\n const platform = await (await this.getDriver().getCapabilities()).getPlatform();\n await input.sendKeys(platform === 'mac' ? Key.COMMAND : Key.CONTROL, 'a');\n await input.sendKeys(Key.DELETE);\n }\n\n // Regular sendKeys does not work with InputSensitiveText, so we use the action\n // framework instead. This uses the native gestures framework of the drivers\n // and simulates keyboard entry. Note: actions.sendKeys doesn't target a specific\n // element - it just sends keys to the browser as though the user were to type it.\n // The input must have focus for it to work (which we already do earlier).\n const actions = this.getDriver().actions();\n value && (await actions.sendKeys(value).perform());\n\n return this.getDriver().executeAsyncScript(\n `\n let el = arguments[0];\n let done = arguments[1];\n el.validate().then(done).catch(done);\n `,\n this\n );\n }\n }\n\n /**\n * Clears the value of the component.\n */\n clear(): Promise<void> {\n return this.changeValue(null);\n }\n}\n"]}
|
|
@@ -19,19 +19,17 @@ class InputTextWebElement extends InputTextWebElementBase_1.InputTextWebElementB
|
|
|
19
19
|
const disabled = await this.getDisabled();
|
|
20
20
|
if (!(disabled || readonly)) {
|
|
21
21
|
await this.whenBusyContextReady();
|
|
22
|
-
// Note that using element.clear() will blur, which commits the change and
|
|
23
|
-
//
|
|
24
|
-
// Instead
|
|
25
|
-
// in a new value. We mock committing the value by calling validate().
|
|
26
|
-
let currValue = await this.getProperty('rawValue');
|
|
27
|
-
while (currValue) {
|
|
28
|
-
const backspaces = new Array(currValue.length + 1).join(selenium_webdriver_1.Key.BACK_SPACE);
|
|
29
|
-
// First move the cursor to the end, then backspaces.
|
|
30
|
-
await this.sendKeys([selenium_webdriver_1.Key.END, backspaces].join(''));
|
|
31
|
-
currValue = await this.getProperty('rawValue');
|
|
32
|
-
}
|
|
22
|
+
// Note that using element.clear() will blur, which commits the change and calls
|
|
23
|
+
// onValueChanged, which we don't want until we're done updating the value.
|
|
24
|
+
// Instead do select-all, then delete to clear the value.
|
|
33
25
|
const input = await this.findElement(selenium_webdriver_1.By.css('input'));
|
|
34
|
-
|
|
26
|
+
const currValue = await this.getRawValue();
|
|
27
|
+
if (currValue) {
|
|
28
|
+
const platform = await (await this.getDriver().getCapabilities()).getPlatform();
|
|
29
|
+
await input.sendKeys(platform === 'mac' ? selenium_webdriver_1.Key.COMMAND : selenium_webdriver_1.Key.CONTROL, 'a');
|
|
30
|
+
await input.sendKeys(selenium_webdriver_1.Key.DELETE);
|
|
31
|
+
}
|
|
32
|
+
value !== null && (await input.sendKeys(value));
|
|
35
33
|
return this.getDriver().executeAsyncScript(`
|
|
36
34
|
let el = arguments[0];
|
|
37
35
|
let done = arguments[1];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputTextWebElement.js","sourceRoot":"","sources":["InputTextWebElement.ts"],"names":[],"mappings":";;;AAAA,qEAAoE;AACpE,yDAA6C;AAE7C;;;;GAIG;AACH,MAAa,mBAAoB,SAAQ,iDAAuB;IAC9D;;;OAGG;IACI,KAAK,CAAC,WAAW,CAAC,KAA6B;QACpD,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC,aAAa,CAAC,sBAAsB,EAAE,IAAI,CAAC,CAAC;QACnE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QAC1C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QAC1C,IAAI,CAAC,CAAC,QAAQ,IAAI,QAAQ,CAAC,EAAE,CAAC;YAC5B,MAAM,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAElC,
|
|
1
|
+
{"version":3,"file":"InputTextWebElement.js","sourceRoot":"","sources":["InputTextWebElement.ts"],"names":[],"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;QACJ,CAAC;IACH,CAAC;IAED;;OAEG;IACH,KAAK;QACH,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;CACF;AAzCD,kDAyCC","sourcesContent":["import { InputTextWebElementBase } from './InputTextWebElementBase';\nimport { By, Key } from 'selenium-webdriver';\n\n/**\n * The component WebElement for [oj-c-input-text](../../../oj-c/docs/oj.InputText.html).\n * Do not instantiate this class directly, instead, use\n * [findInputText](../functions/findInputText.html).\n */\nexport class InputTextWebElement extends InputTextWebElementBase {\n /**\n * Sets the value of the \"value\" property of the input component.\n * @param value The value to set for the <code>value</code>\n */\n public async changeValue(value: string | number | null): Promise<void> {\n await this.getDriver().executeScript('arguments[0].focus()', this);\n const readonly = await this.getReadonly();\n const disabled = await this.getDisabled();\n if (!(disabled || readonly)) {\n await this.whenBusyContextReady();\n\n // Note that using element.clear() will blur, which commits the change and calls\n // onValueChanged, which we don't want until we're done updating the value.\n // Instead do select-all, then delete to clear the value.\n const input = await this.findElement(By.css('input'));\n const currValue = await this.getRawValue();\n if (currValue) {\n const platform = await (await this.getDriver().getCapabilities()).getPlatform();\n await input.sendKeys(platform === 'mac' ? Key.COMMAND : Key.CONTROL, 'a');\n await input.sendKeys(Key.DELETE);\n }\n value !== null && (await input.sendKeys(value));\n\n return this.getDriver().executeAsyncScript(\n `\n let el = arguments[0];\n let done = arguments[1];\n el.validate().then(done).catch(done);\n `,\n this\n );\n }\n }\n\n /**\n * Clears the value of the component.\n */\n clear(): Promise<void> {\n return this.changeValue(null);\n }\n}\n"]}
|