codeceptjs 4.0.0-rc.1 → 4.0.0-rc.2
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.
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Checks that current URL path does NOT match the expected path.
|
|
2
|
+
Query strings and URL fragments are ignored.
|
|
3
|
+
|
|
4
|
+
```js
|
|
5
|
+
I.dontSeeCurrentPathEquals('/form'); // fails for '/form', '/form?user=1', '/form#section'
|
|
6
|
+
I.dontSeeCurrentPathEquals('/'); // fails for '/', '/?user=ok', '/#top'
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
@param {string} path value to check.
|
|
10
|
+
@returns {void} automatically synchronized promise through #recorder
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Checks that current URL path matches the expected path.
|
|
2
|
+
Query strings and URL fragments are ignored.
|
|
3
|
+
|
|
4
|
+
```js
|
|
5
|
+
I.seeCurrentPathEquals('/info'); // passes for '/info', '/info?user=1', '/info#section'
|
|
6
|
+
I.seeCurrentPathEquals('/'); // passes for '/', '/?user=ok', '/#top'
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
@param {string} path value to check.
|
|
10
|
+
@returns {void} automatically synchronized promise through #recorder
|
package/lib/helper/Playwright.js
CHANGED
|
@@ -2405,6 +2405,26 @@ class Playwright extends Helper {
|
|
|
2405
2405
|
urlEquals(this.options.url).negate(url, await this._getPageUrl())
|
|
2406
2406
|
}
|
|
2407
2407
|
|
|
2408
|
+
/**
|
|
2409
|
+
* {{> seeCurrentPathEquals }}
|
|
2410
|
+
*/
|
|
2411
|
+
async seeCurrentPathEquals(path) {
|
|
2412
|
+
const currentUrl = await this._getPageUrl()
|
|
2413
|
+
const baseUrl = this.options.url || 'http://localhost'
|
|
2414
|
+
const actualPath = new URL(currentUrl, baseUrl).pathname
|
|
2415
|
+
return equals('url path').assert(path, actualPath)
|
|
2416
|
+
}
|
|
2417
|
+
|
|
2418
|
+
/**
|
|
2419
|
+
* {{> dontSeeCurrentPathEquals }}
|
|
2420
|
+
*/
|
|
2421
|
+
async dontSeeCurrentPathEquals(path) {
|
|
2422
|
+
const currentUrl = await this._getPageUrl()
|
|
2423
|
+
const baseUrl = this.options.url || 'http://localhost'
|
|
2424
|
+
const actualPath = new URL(currentUrl, baseUrl).pathname
|
|
2425
|
+
return equals('url path').negate(path, actualPath)
|
|
2426
|
+
}
|
|
2427
|
+
|
|
2408
2428
|
/**
|
|
2409
2429
|
* {{> see }}
|
|
2410
2430
|
*
|
package/lib/helper/Puppeteer.js
CHANGED
|
@@ -1684,6 +1684,26 @@ class Puppeteer extends Helper {
|
|
|
1684
1684
|
urlEquals(this.options.url).negate(url, await this._getPageUrl())
|
|
1685
1685
|
}
|
|
1686
1686
|
|
|
1687
|
+
/**
|
|
1688
|
+
* {{> seeCurrentPathEquals }}
|
|
1689
|
+
*/
|
|
1690
|
+
async seeCurrentPathEquals(path) {
|
|
1691
|
+
const currentUrl = await this._getPageUrl()
|
|
1692
|
+
const baseUrl = this.options.url || 'http://localhost'
|
|
1693
|
+
const actualPath = new URL(currentUrl, baseUrl).pathname
|
|
1694
|
+
return equals('url path').assert(path, actualPath)
|
|
1695
|
+
}
|
|
1696
|
+
|
|
1697
|
+
/**
|
|
1698
|
+
* {{> dontSeeCurrentPathEquals }}
|
|
1699
|
+
*/
|
|
1700
|
+
async dontSeeCurrentPathEquals(path) {
|
|
1701
|
+
const currentUrl = await this._getPageUrl()
|
|
1702
|
+
const baseUrl = this.options.url || 'http://localhost'
|
|
1703
|
+
const actualPath = new URL(currentUrl, baseUrl).pathname
|
|
1704
|
+
return equals('url path').negate(path, actualPath)
|
|
1705
|
+
}
|
|
1706
|
+
|
|
1687
1707
|
/**
|
|
1688
1708
|
* {{> see }}
|
|
1689
1709
|
*
|
package/lib/helper/WebDriver.js
CHANGED
|
@@ -1844,6 +1844,26 @@ class WebDriver extends Helper {
|
|
|
1844
1844
|
return urlEquals(this.options.url).negate(url, decodeUrl(res))
|
|
1845
1845
|
}
|
|
1846
1846
|
|
|
1847
|
+
/**
|
|
1848
|
+
* {{> seeCurrentPathEquals }}
|
|
1849
|
+
*/
|
|
1850
|
+
async seeCurrentPathEquals(path) {
|
|
1851
|
+
const currentUrl = await this.browser.getUrl()
|
|
1852
|
+
const baseUrl = this.options.url || 'http://localhost'
|
|
1853
|
+
const actualPath = new URL(currentUrl, baseUrl).pathname
|
|
1854
|
+
return equals('url path').assert(path, actualPath)
|
|
1855
|
+
}
|
|
1856
|
+
|
|
1857
|
+
/**
|
|
1858
|
+
* {{> dontSeeCurrentPathEquals }}
|
|
1859
|
+
*/
|
|
1860
|
+
async dontSeeCurrentPathEquals(path) {
|
|
1861
|
+
const currentUrl = await this.browser.getUrl()
|
|
1862
|
+
const baseUrl = this.options.url || 'http://localhost'
|
|
1863
|
+
const actualPath = new URL(currentUrl, baseUrl).pathname
|
|
1864
|
+
return equals('url path').negate(path, actualPath)
|
|
1865
|
+
}
|
|
1866
|
+
|
|
1847
1867
|
/**
|
|
1848
1868
|
* Wraps [execute](http://webdriver.io/api/protocol/execute.html) command.
|
|
1849
1869
|
*
|