From bc18f8545c5e95fe329b390aff02831ba48e10fb Mon Sep 17 00:00:00 2001 From: Omkar Harade Date: Fri, 22 Nov 2024 17:40:20 +0530 Subject: [PATCH] changed expect api index docs --- docs/api/expect/index.md | 87 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 84 insertions(+), 3 deletions(-) diff --git a/docs/api/expect/index.md b/docs/api/expect/index.md index 29f7492..b7a55ca 100644 --- a/docs/api/expect/index.md +++ b/docs/api/expect/index.md @@ -98,7 +98,54 @@ These methods will perform assertions on the specified target on the current ele -<%- include('./_cookie.md') %> + + + + + +
+ +Expect assertions operating on a single cookie after retrieving the entire cookie string, using `.getCookies()`. + +
Syntax:
+
+
browser.expect.cookie('cookie-name', ['cookie-domain'])
+
+ +
+
this.demoTest = function (browser) {
+  browser.expect.cookie('cookie-name').to.contain('cookie-value');
+  browser.expect.cookie('cookie-name').to.match(/regex/);
+  browser.expect.cookie('loginCookie', 'example.org').to.contain('cookie-value');
+};
+
+ +
Parameters:
+
+ + + + + + + + + + + + + + + + + + + + +
NameTypedescription
nameStringThe name of the cookie to be inspected.
domain
Optional
StringThe domain name on which the cookie is set to.
+
+
+

expect.element()

@@ -120,5 +167,39 @@ These methods will perform assertions on the specified target on the current ele ### Assertions: - [count()](/api/expect/elements/count.html) -<%- include('./_title.md') %> -<%- include('./_url.md') %> \ No newline at end of file + + + + +

expect.title()

+ +
+ +Retrieves the page title value in order to be used for performing `equal`, `match` or `contains` assertions on it. + +
Usage:
+
+
this.demoTest = function (browser) {
+  browser.expect.title().to.contain('value');
+  browser.expect.title().to.match(/value/);
+};
+
+
+ + + + + +

expect.url()

+
+ +Retrieves the page url value in order to be used for performing `equal`, `match` or `contains` assertions on it. + +
Usage:
+
+
this.demoTest = function (browser) {
+  browser.expect.url().to.contain('https://');
+  browser.expect.url().to.endWith('.org');
+};
+
+
\ No newline at end of file