@atomic-testing/component-driver-html
Advanced tools
Comparing version 0.24.0 to 0.25.0
@@ -1,2 +0,2 @@ | ||
import { ComponentDriver, IInputDriver, Nullable, PartLocatorType } from '@atomic-testing/core'; | ||
import { ComponentDriver, IInputDriver, Nullable } from '@atomic-testing/core'; | ||
import { HTMLOptionDriver } from './HTMLOptionDriver'; | ||
@@ -8,3 +8,2 @@ type ValueT = string | readonly string[]; | ||
setValue(value: Nullable<ValueT>): Promise<boolean>; | ||
getOptionByLocator(itemLocator: PartLocatorType): Promise<HTMLOptionDriver | null>; | ||
getOptionByIndex(index: number): Promise<HTMLOptionDriver | null>; | ||
@@ -11,0 +10,0 @@ getValuesByLabels(labels: readonly string[]): Promise<readonly string[]>; |
@@ -15,2 +15,3 @@ "use strict"; | ||
const HTMLOptionDriver_1 = require("./HTMLOptionDriver"); | ||
const optionLocator = (0, core_1.byTagName)('option'); | ||
class HTMLSelectDriver extends core_1.ComponentDriver { | ||
@@ -41,21 +42,6 @@ isMultiple() { | ||
} | ||
getOptionByLocator(itemLocator) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const locator = core_1.locatorUtil.append(this.locator, itemLocator); | ||
const exists = yield this.interactor.exists(locator); | ||
if (exists) { | ||
return new HTMLOptionDriver_1.HTMLOptionDriver(locator, this.interactor); | ||
} | ||
else { | ||
return null; | ||
} | ||
}); | ||
} | ||
getOptionByIndex(index) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const itemLocator = { | ||
type: core_1.LocatorType.Css, | ||
selector: `option:nth-of-type(${index + 1})`, | ||
}; | ||
return this.getOptionByLocator(itemLocator); | ||
const itemLocatorBase = core_1.locatorUtil.append(this.locator, optionLocator); | ||
return core_1.driverHelper.getListItemByIndex(this, itemLocatorBase, index, HTMLOptionDriver_1.HTMLOptionDriver); | ||
}); | ||
@@ -62,0 +48,0 @@ } |
{ | ||
"name": "@atomic-testing/component-driver-html", | ||
"version": "0.24.0", | ||
"version": "0.25.0", | ||
"description": "HTML component driver for atomic-testing", | ||
@@ -25,3 +25,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@atomic-testing/core": "0.24.0" | ||
"@atomic-testing/core": "0.25.0" | ||
}, | ||
@@ -28,0 +28,0 @@ "devDependencies": { |
@@ -1,9 +0,2 @@ | ||
import { | ||
ComponentDriver, | ||
IInputDriver, | ||
LocatorType, | ||
locatorUtil, | ||
Nullable, | ||
PartLocatorType, | ||
} from '@atomic-testing/core'; | ||
import { byTagName, ComponentDriver, driverHelper, IInputDriver, locatorUtil, Nullable } from '@atomic-testing/core'; | ||
@@ -13,2 +6,3 @@ import { HTMLOptionDriver } from './HTMLOptionDriver'; | ||
type ValueT = string | readonly string[]; | ||
const optionLocator = byTagName('option'); | ||
@@ -37,18 +31,5 @@ export class HTMLSelectDriver extends ComponentDriver<{}> implements IInputDriver<Nullable<ValueT>> { | ||
async getOptionByLocator(itemLocator: PartLocatorType): Promise<HTMLOptionDriver | null> { | ||
const locator = locatorUtil.append(this.locator, itemLocator); | ||
const exists = await this.interactor.exists(locator); | ||
if (exists) { | ||
return new HTMLOptionDriver(locator, this.interactor); | ||
} else { | ||
return null; | ||
} | ||
} | ||
async getOptionByIndex(index: number): Promise<HTMLOptionDriver | null> { | ||
const itemLocator: PartLocatorType = { | ||
type: LocatorType.Css, | ||
selector: `option:nth-of-type(${index + 1})`, | ||
}; | ||
return this.getOptionByLocator(itemLocator); | ||
const itemLocatorBase = locatorUtil.append(this.locator, optionLocator); | ||
return driverHelper.getListItemByIndex(this, itemLocatorBase, index, HTMLOptionDriver); | ||
} | ||
@@ -55,0 +36,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
51168
830
+ Added@atomic-testing/core@0.25.0(transitive)
- Removed@atomic-testing/core@0.24.0(transitive)
Updated@atomic-testing/core@0.25.0