chai-webdriverio: Provides its own types (#39640)

This commit is contained in:
Alexander T
2019-10-28 20:44:50 -07:00
committed by Jesse Trinity
parent eb67853f57
commit 833398dc34
6 changed files with 6 additions and 92 deletions
+6
View File
@@ -384,6 +384,12 @@
"sourceRepoURL": "https://github.com/chaijs/chai-http",
"asOfVersion": "4.2.0"
},
{
"libraryName": "chai-webdriverio",
"typingsPackageName": "chai-webdriverio",
"sourceRepoURL": "https://github.com/marcodejongh/chai-webdriverio",
"asOfVersion": "1.0.0"
},
{
"libraryName": "chalk",
"typingsPackageName": "chalk",
@@ -1,30 +0,0 @@
import chai = require('chai');
import webdriverio = require('webdriverio');
import chaiWebdriverio = require('chai-webdriverio');
const options = {
desiredCapabilities: {
browserName: 'firefox'
}
};
const browser = webdriverio.remote(options);
chai.use(chaiWebdriverio(browser));
const selector = 'Hello, World!';
chai.expect(selector).to.be.there();
chai.expect(selector).to.be.visible();
chai.expect(selector).to.have.text(selector);
chai.expect(selector).to.have.text(/regex/);
chai.expect(selector).to.have.count(10);
chai.expect(selector).to.have.value('x');
chai.expect(selector).to.have.value(/regex/);
chai.expect(selector).to.have.focus();
-25
View File
@@ -1,25 +0,0 @@
// Type definitions for chai-webdriverio 0.4
// Project: https://github.com/marcodejongh/chai-webdriverio
// Definitions by: Nikolai Orekhov <https://github.com/sherlock1982>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.0
/// <reference types="webdriverio" />
/// <reference types="chai" />
declare namespace Chai {
interface Assertion {
count: (count: number) => void;
focus: () => void;
text: (expected: string|number|RegExp) => void;
there: () => void;
value: (expected: string|number|RegExp) => void;
visible: () => void;
immediately: Assertion;
}
}
declare module 'chai-webdriverio' {
function chaiWebdriverIO(client: WebdriverIO.Client<void>, options?: any): Chai.ChaiPlugin;
export = chaiWebdriverIO;
}
-6
View File
@@ -1,6 +0,0 @@
{
"private": true,
"dependencies": {
"@types/webdriverio": "^4.0.0"
}
}
-24
View File
@@ -1,24 +0,0 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"chai-webdriverio-tests.ts"
]
}
-7
View File
@@ -1,7 +0,0 @@
{
"extends": "dtslint/dt.json",
"rules": {
"no-single-declare-module" : false,
"no-declare-current-package": false
}
}