Created
February 19, 2021 10:38
-
-
Save kant01ne/ae6c0ba190c0a1fda7a4a11f9d59235c to your computer and use it in GitHub Desktop.
VSCode page.screen.code-snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
// Place your supertokens-auth-react workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and | |
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope | |
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is | |
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are: | |
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. | |
// Placeholders with the same ids are connected. | |
// Example: | |
"Comment Block": { | |
"scope": "javascript,javascriptreact,typescriptreact,typescript,html", | |
"prefix": "cmtblock", | |
"body": [ | |
"$BLOCK_COMMENT_START", | |
" * $1", | |
" $BLOCK_COMMENT_END" | |
], | |
"description": "Comment Block" | |
}, | |
"Is Undefined block": { | |
"scope": "javascript, typescript", | |
"prefix": "isundefined", | |
"body": [ | |
"if ($1 === undefined) {", | |
"\t$2", | |
"}", | |
"$3" | |
], | |
"description": "Comment Block" | |
}, | |
"Puppeteer page screenshot": { | |
"scope": "javascript,typescript", | |
"prefix": "ppscreen", | |
"body": [ | |
"await page.screenshot({path: 'screenshot.jpeg'});", | |
], | |
"description": "Puppeteer page screenshot" | |
}, | |
"Puppeteer Page wait for navigation": { | |
"scope": "javascript", | |
"prefix": "ppidle", | |
"body": [ | |
"await page.waitForNavigation({ waitUntil: \"networkidle0\" });", | |
], | |
"description": "Puppeteer Page wait for navigation" | |
}, | |
"Puppeteer parallel with wait for navigation": { | |
"scope": "javascript", | |
"prefix": "ppidleparrallel", | |
"body": [ | |
"await Promise.all([", | |
"\t$1,", | |
"\tpage.waitForNavigation({ waitUntil: \"networkidle0\" })", | |
"]);", | |
], | |
"description": "Puppeteer Page wait for navigation parallel" | |
}, | |
"Puppeteer assert pathname": { | |
"scope": "javascript", | |
"prefix": "ppassertpathname", | |
"body": [ | |
"const pathname = await page.evaluate(() => window.location.pathname);", | |
"assert.deepStrictEqual(pathname, \"$1\");", | |
], | |
"description": "Puppeteer assert pathname" | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment