I am using Cypress5.0. I have configured the screenshots folder in cypress.json.
And I am running tests using cypress runner API programmatically.
I am using viewport values as :
config.viewportWidth = 1080;
config.viewportHeight = 1024;
The screenshot is coming, but it is not on the full page. My web page has scrolling, the screenshot is taking only visible area.
Please guide how to take full-page screen.
My Cypress.json
{
"projectId": "yvs41u",
"video": false,
"integrationFolder": "integration-tests/experiences",
"testFiles": "**/*.js",
"fixturesFolder": false,
"pluginsFile": "plugins/index.js",
"supportFile": "support/index.js",
"screenshotsFolder": "build/reports",
"videosFolder": "build/reports",
"videoUploadOnPasses": false,
"trashAssetsBeforeRuns": false,
"reporter": "mochawesome",
"chromeWebSecurity": false,
"reporterOptions": {
"charts": true,
"html": false,
"json": true,
"reportDir": "cypress/reports/mochawesome",
"reportTitle": "Archie Integration Testing Suite",
"reportFilename": "report",
"overwrite": false,
"inline": true,
"inlineAssets": true,
"timestamp": "dd-mmm-yyyy-HH-MM-ss"
}
}
Cypress by default captures only a viewport. In order to screenshot the whole page you need to configure the screenshot first:
Cypress.Screenshot.defaults({ capture: 'fullPage' });
cy.screenshot();
As a result whole page will be captured.
Further read: https://docs.cypress.io/api/cypress-api/screenshot-api.html
Related
I made the mistake of following a youtube video to improve setup of VS code, after making the adjustments I always get the settings sync error message. I click on show error file, and highlights the editor.fontSize line. I cannot see anything wrong with it personally:
{
"workbench.colorTheme": "Cobalt2",
"security.workspace.trust.untrustedFiles": "open",
"window.zoomLevel": 1,
"liveServer.settings.donotShowInfoMsg": true,
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.formatOnSave": true,
"editor.formatOnSaveMode": "modificationsIfAvailable",
"html.format.indentInnerHtml": true,
"[css]": {
"editor.defaultFormatter": "michelemelluso.code-beautifier"
},
"sync.gist": "7aea226d700927d0abdecbd3c2260369",
"sync.autoDownload": true,
"sync.quietSync": true,
"liveSassCompile.settings.watchOnLaunch": true,
"liveSassCompile.settings.formats": [
{
"format": "expanded",
"extensionName": ".css",
"savePath": "/css/style.css"
},
]
}
"editor.fontSize": 14,
"editor.tabSize": 2,
"editor.guides.bracketPairs": true,
"editor.guides.bracketPairsHorizontal": true,
"editor.wordWrap": "on",
"workbench.iconTheme": "vscode-icons"
I have tried uninstalling many many times and all my settings get restored and never go back to default. I have tried advice here as to making some changes from other peoples similar problems, but nothing seems to work. Any assistance would be greatly appreciated, this pops up any time I try to make a settings change also.
try to delete this section
"sync.gist": "7aea226d700927d0abdecbd3c2260369",
"sync.autoDownload": true,
"sync.quietSync": true,
According to the Documentation for AppKiller Assault,
When the configured methods are called in the application, the Chaos Monkey will shut down the application.
But I am not able to achieve this. I configured the watcher bean but as soon as I call /attack API, my application is getting terminated. Instead what I want is when the program is executing the particular bean, then only it should terminate.
Here is my assault setting
{
"level": 5,
"latencyRangeStart": 2000,
"latencyRangeEnd": 5000,
"latencyActive": false,
"exceptionsActive": false,
"exception":{
"type": null,
"arguments": null
},
"killApplicationActive": true,
"memoryActive": false,
"memoryMillisecondsHoldFilledMemory": 90000,
"memoryMillisecondsWaitNextIncrease": 1000,
"memoryFillIncrementFraction": 0.15,
"memoryFillTargetFraction": 0.25,
"runtimeAssaultCronExpression": "OFF",
"watchedCustomServices":[
"myclass.method"
]
}
And Here is my watcher config
{
"controller": false,
"restController": false,
"service": true,
"repository": true,
"component": true,
"beans ": [
"myBean"
]
}
Even if I set runtimeAssaultCronExpression
along with killApplicationActive to true, it immediately shut down the application.
can someone point the mistake I am doing ?
How to install bazel for golang application building in VScode?
There is no direct support for Bazel yet, as per golang/go issue 37205 ("x/tools/gopls: support for bazel-based projects")
bazelbuild/rules_go wiki/Editor-and-tool-integration has a design document for building editor and tool integration: a new gopackagesdriver binary that integrates Bazel+rules_go with golang.org/x/tools/go/packages.
But it is not fully implemented yet (Q1 2022).
In the meantime, you can follow Bazel IDE setup, which involves:
Create a launcher script, say tools/gopackagesdriver.sh:
#!/usr/bin/env bash
exec bazel run -- #io_bazel_rules_go//go/tools/gopackagesdriver "${#}"
adding in the .vscode/settings.json of your workspace:
{
"go.goroot": "${workspaceFolder}/bazel-${workspaceFolderBasename}/external/go_sdk",
"go.toolsEnvVars": {
"GOPACKAGESDRIVER": "${workspaceFolder}/tools/gopackagesdriver.sh"
},
"go.enableCodeLens": {
"references": false,
"runtest": false
},
"gopls": {
"build.directoryFilters": [
"-bazel-bin",
"-bazel-out",
"-bazel-testlogs",
"-bazel-mypkg",
],
"formatting.gofumpt": true,
"formatting.local": "github.com/my/mypkg",
"ui.completion.usePlaceholders": true,
"ui.semanticTokens": true,
"ui.codelenses": {
"gc_details": false,
"regenerate_cgo": false,
"generate": false,
"test": false,
"tidy": false,
"upgrade_dependency": false,
"vendor": false
},
},
"go.useLanguageServer": true,
"go.buildOnSave": "off",
"go.lintOnSave": "off",
"go.vetOnSave": "off",
}
I am trying to get the webviewlink of google shared
API: https://www.googleapis.com/drive/v3/files
am unable to get webviewlink of particular shared drive folder.
my input will be the folder id:
{
"id": "1Vat7pdwnpg8i2xMzhic4dOVbadZNv0OJ"
}
how can i achieve this?
Without seeing the exact request you are making its hard to help but i can say this apears to work fine. I can get the the record for a google drive directory shared with me and that directory contains a web view link which has the same file id as the one i sent.
Request
curl \
'https://www.googleapis.com/drive/v3/files/1nhladm_nRRee6rVER9ZA5QqnyKwfG7l?fields=*&key=[YOUR_API_KEY]' \
--header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \
--header 'Accept: application/json' \
--compressed
response
{
"kind": "drive#file",
"id": "1nhladm_nRRee6rVER9ZA5QqnyKwfG7l",
"name": "ML GDE Model Deployment Project",
"mimeType": "application/vnd.google-apps.folder",
"starred": false,
"trashed": false,
"explicitlyTrashed": false,
"parents": [
"1OYYiVmqFp9ZvuRSuVgC_ihkdYirLnu"
],
"spaces": [
"drive"
],
"version": "461",
"webViewLink": "https://drive.google.com/drive/folders/1nhladm_nRRee6rVER9ZA5QqnyKwfG7li",
"iconLink": "https://drive-thirdparty.googleusercontent.com/16/type/application/vnd.google-apps.folder+shared",
"hasThumbnail": false,
"thumbnailVersion": "0",
"viewedByMe": false,
"createdTime": "2020-04-02T04:21:47.275Z",
"modifiedTime": "2020-11-02T13:58:51.042Z",
"modifiedByMe": false,
"owners": [
{
.....
}
],
"lastModifyingUser": {
"kind": "drive#user",
},
"shared": true,
"ownedByMe": false,
"capabilities": {
"canAddChildren": false,
"canAddMyDriveParent": false,
"canChangeCopyRequiresWriterPermission": false,
"canChangeViewersCanCopyContent": false,
"canComment": false,
"canCopy": false,
"canDelete": false,
"canDownload": true,
"canEdit": false,
"canListChildren": true,
"canModifyContent": false,
"canMoveChildrenWithinDrive": false,
"canMoveItemIntoTeamDrive": false,
"canMoveItemOutOfDrive": false,
"canMoveItemWithinDrive": false,
"canReadRevisions": false,
"canRemoveChildren": false,
"canRemoveMyDriveParent": true,
"canRename": false,
"canShare": false,
"canTrash": false,
"canUntrash": false
},
"viewersCanCopyContent": true,
"copyRequiresWriterPermission": false,
"writersCanShare": true,
"folderColorRgb": "#8f8f8f",
"quotaBytesUsed": "0",
"isAppAuthorized": false
}
The web view link for this request is https://drive.google.com/drive/folders/1nhladm_nRRee6rVER9ZA5QqnyKwfG7l which is the same as the file id that i sent it.
File Ids change as do the web view links and its possible that they are out of sync.
What's the simplest folder structure I can use with Nightwatchjs? It will be used locally and for continuous integration. Currently I can't even get the demo to work. I have six errors:
module.js:469:15
module.js:417:25
bootstrap_node.js:604.10
bootstrap_node.js:394:7
bootstrap_node.js:149:9
bootstrap_node.js:509:3.
I realize this is a beginner question. I've been using Telerik and TestComplete for a few years and now we want to do CI properly so Selenium is the way to go. I'm comfortable with javascript but kind of bad at file path stuff.
What's the simplest folder structure I can use with Nightwatchjs?
The simplest NightwatchJS folder structure is:
To have 2 files (a configuration file and a file which contain you tests):
nightwatch.json
app.js (you can rename it as you want)
Example
1) nightwatch.json
{
"src_folders": [
"app.js"
],
"live_output": false,
"tests_output": "test/tests_output/",
"detailed_output": true,
"selenium": {
"start_process": false,
"host": "hub.browserstack.com",
"port": 80
},
"test_workers": {
"enabled": false,
"workers": "auto"
},
"test_settings": {
"chrome": {
"selenium_port": 80,
"selenium_host": "hub.browserstack.com",
"silent": true,
"desiredCapabilities": {
"os": "Windows",
"os_version": "10",
"browserName": "chrome",
"resolution": "1024x768",
"javascriptEnabled": true,
"acceptSslCerts": true,
"browserstack.video": "true",
"browserstack.debug": "true",
"browserstack.user": "<yourUsername>",
"browserstack.key": "<yourPassword>"
}
}
}
}
2) app.js
module.exports = {
'Does-stackoverflow-works': function (browser) {
browser
.url("http://stackoverflow.com/questions")
.waitForElementPresent('body', 2000, "Display latest Stackoverflow questions")
.end()
}
};
Run
$> nightwatch --env chrome
Output