From 12440402dead79a39502bf61dfc7dbdc663e8158 Mon Sep 17 00:00:00 2001 From: Hlawuleka Date: Thu, 7 Sep 2023 14:27:05 +0200 Subject: [PATCH 1/5] docs: add example for using the get method --- docs/api/queries/get.mdx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/api/queries/get.mdx b/docs/api/queries/get.mdx index 3d0debae54..6893c51db2 100644 --- a/docs/api/queries/get.mdx +++ b/docs/api/queries/get.mdx @@ -143,6 +143,12 @@ cy.get('form').within(() => { }) ``` +#### Find an anchor element by it's label/text, remove some attribute and click it + +```javascript +cy.get("a", { name: "My link text" }).invoke("removeAttr", "target").click(); +``` + ### Get vs Find The `cy.get` command always starts its search from the From bc28c3280a5949088f05cd306ede70c4eecf1e7a Mon Sep 17 00:00:00 2001 From: Hlawuleka Date: Thu, 7 Sep 2023 14:50:50 +0200 Subject: [PATCH 2/5] grammar correction from reviewer Co-authored-by: Mike McCready <66998419+MikeMcC399@users.noreply.github.com> --- docs/api/queries/get.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api/queries/get.mdx b/docs/api/queries/get.mdx index 6893c51db2..9f13ca790e 100644 --- a/docs/api/queries/get.mdx +++ b/docs/api/queries/get.mdx @@ -143,7 +143,7 @@ cy.get('form').within(() => { }) ``` -#### Find an anchor element by it's label/text, remove some attribute and click it +#### Find an anchor element by its label/text, remove some attribute and click it ```javascript cy.get("a", { name: "My link text" }).invoke("removeAttr", "target").click(); From 7bfdc9757afd5ed9a03a556c2a9472f53b52351b Mon Sep 17 00:00:00 2001 From: Hlawuleka Date: Thu, 7 Sep 2023 14:52:35 +0200 Subject: [PATCH 3/5] use single quotes for consistency --- docs/api/queries/get.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api/queries/get.mdx b/docs/api/queries/get.mdx index 9f13ca790e..9e5aaf946c 100644 --- a/docs/api/queries/get.mdx +++ b/docs/api/queries/get.mdx @@ -146,7 +146,7 @@ cy.get('form').within(() => { #### Find an anchor element by its label/text, remove some attribute and click it ```javascript -cy.get("a", { name: "My link text" }).invoke("removeAttr", "target").click(); +cy.get("a", { name: 'My link text' }).invoke("removeAttr", "target").click(); ``` ### Get vs Find From 46a1bb8b39495a4a35d811afcd64ed9a2421d3e9 Mon Sep 17 00:00:00 2001 From: Hlawuleka Date: Thu, 7 Sep 2023 14:53:22 +0200 Subject: [PATCH 4/5] use single quotes for targert element --- docs/api/queries/get.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api/queries/get.mdx b/docs/api/queries/get.mdx index 9e5aaf946c..8045ddb312 100644 --- a/docs/api/queries/get.mdx +++ b/docs/api/queries/get.mdx @@ -146,7 +146,7 @@ cy.get('form').within(() => { #### Find an anchor element by its label/text, remove some attribute and click it ```javascript -cy.get("a", { name: 'My link text' }).invoke("removeAttr", "target").click(); +cy.get('a', { name: 'My link text' }).invoke("removeAttr", "target").click(); ``` ### Get vs Find From 46c1f4f17b4f254721dc10b6cb931aec70a51526 Mon Sep 17 00:00:00 2001 From: Hlawuleka Date: Thu, 7 Sep 2023 14:54:32 +0200 Subject: [PATCH 5/5] final revision for correcting single quotes --- docs/api/queries/get.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api/queries/get.mdx b/docs/api/queries/get.mdx index 8045ddb312..d4e18d64ea 100644 --- a/docs/api/queries/get.mdx +++ b/docs/api/queries/get.mdx @@ -146,7 +146,7 @@ cy.get('form').within(() => { #### Find an anchor element by its label/text, remove some attribute and click it ```javascript -cy.get('a', { name: 'My link text' }).invoke("removeAttr", "target").click(); +cy.get('a', { name: 'My link text' }).invoke('removeAttr', 'target').click(); ``` ### Get vs Find