Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Update clearCookie documentation for Playwright helper #4005

Merged
merged 3 commits into from
Nov 20, 2023

Conversation

Hellosager
Copy link
Contributor

Motivation/Description of the PR

Me and a co-worker were wondering why all cookies got deleted when calling Playwright helper clearCookie function with the cookie specified. After checking the source code, I saw the comment of this not beeing a feature in playwright.

I updated the broken link in the code comment and the documentation of the helper.

Applicable helpers:

  • Playwright
  • Puppeteer
  • WebDriver
  • REST
  • FileHelper
  • Appium
  • TestCafe

Applicable plugins:

  • allure
  • autoDelay
  • autoLogin
  • customLocator
  • pauseOnFail
  • coverage
  • retryFailedStep
  • screenshotOnFail
  • selenoid
  • stepByStepReport
  • stepTimeout
  • wdio
  • subtitles

Type of change

  • 🔥 Breaking changes
  • 🚀 New functionality
  • 🐛 Bug fix
  • 📋 Documentation changes/updates
  • ♨️ Hot fix
  • 🔨 Markdown files fix - not related to source code
  • 💅 Polish code

Checklist:

  • Tests have been added
  • Documentation has been added (Run npm run docs)
  • Lint checking (Run npm run lint)
  • Local tests are passed (Run npm test)

@kobenguyent
Copy link
Collaborator

I guess you haven't run the npm run docs.

@Hellosager
Copy link
Contributor Author

I guess you haven't run the npm run docs.

This is true, I thought it's just needed for new docs, not editing existing ones.
I checked out my repository and tried npm run docs on Kali now (after realizing windows isn't working) but it seems that it is only rolling back my changes to the current state of the docs.
Where do I have to do my changes so that npm run docs is keeping my changes or what else am I missing?

┌──(kali㉿kali)-[~/Desktop/codecept/CodeceptJS]
└─$ git status     
On branch 3.x
Your branch is up to date with 'origin/3.x'.

nothing to commit, working tree clean

┌──(kali㉿kali)-[~/Desktop/codecept/CodeceptJS]
└─$ git log   
commit e0d1ab1933ca8eaf444d5431ffdcf781ec48007a (HEAD -> 3.x, origin/HEAD, origin/3.x)
Author: Hellosager <sebas.b@web.de>
Date:   Thu Nov 16 22:24:53 2023 +0100

    Remove space

commit f28446a89c064322b3f1a7e998a382398f0e851c
Author: Hellosager <sebas.b@web.de>
Date:   Thu Nov 16 22:20:42 2023 +0100

    Update documentation for Playwright clearCookie

commit 3ec908a8b46ddc0585ab0b73210a65cc027bc400
Author: KobeNguyenT <7845001+kobenguyent@users.noreply.github.com>
Date:   Thu Nov 16 16:08:27 2023 +0100

    release 3.5.8 (#4004)


┌──(kali㉿kali)-[~/Desktop/codecept/CodeceptJS]
└─$ npm run docs

> codeceptjs@3.5.8 docs
> ./runok.js docs
...
Writing documentation for Playwright
[#81 COPY] › ℹ  lib/helper/Playwright.js => docs/build/Playwright.js
[#81 COPY] › ✔  Finished  in 0 ms
[#82 REPLACEINFILE] › ℹ  docs/build/Playwright.js
[#82 REPLACEINFILE] › ✔  Finished  in 29 ms
[#83 NPX] › ℹ  npx documentation build docs/build/Playwright.js -o docs/helpers/Playwright.md -f md --shallow --markdown-toc=false --sort-order=alpha
[#83 NPX] › ✔  Finished  in 531 ms
[#84 REPLACEINFILE] › ℹ  docs/helpers/Playwright.md
[#84 REPLACEINFILE] › ✔  Finished  in 8 ms
[#85 REPLACEINFILE] › ℹ  docs/helpers/Playwright.md
[#85 REPLACEINFILE] › ✔  Finished  in 2 ms
[#86 REPLACEINFILE] › ℹ  docs/helpers/Playwright.md
[#86 REPLACEINFILE] › ✔  Finished  in 0 ms
[#87 WRITETOFILE] › ℹ  /home/kali/Desktop/codecept/CodeceptJS/docs/helpers/Playwright.md
[#87 WRITETOFILE] › ✔  Finished  in 0 ms
...

┌──(kali㉿kali)-[~/Desktop/codecept/CodeceptJS]
└─$ git diff  
diff --git a/docs/helpers/Playwright.md b/docs/helpers/Playwright.md
index b314465f..bf5db3a1 100644
--- a/docs/helpers/Playwright.md
+++ b/docs/helpers/Playwright.md
@@ -518,11 +518,12 @@ I.checkOption('Agree', '.signup', { position: { x: 5, y: 5 } })
 
 ### clearCookie
 
-Clears all cookies. Playwright currently doesn't support to delete a certain cookie.
+Clears a cookie by name,
+if none provided clears all cookies.
 
 ```js
 I.clearCookie();
-I.clearCookie('test'); // currently has the same effect as line above
+I.clearCookie('test');

@kobenguyent kobenguyent changed the title Update clearCookie documentation for Playwright helper docs: Update clearCookie documentation for Playwright helper Nov 20, 2023
@kobenguyent
Copy link
Collaborator

Thank you! Updated!

@kobenguyent kobenguyent merged commit 97c9a1b into codeceptjs:3.x Nov 20, 2023
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants