Atom editor - Open-in-browser Extension - Switch browser - browser

I'm struggling to find out how to switch browsers in the Atom open-in-browser extension. I've looked for settings but I'm stuck with code opening in Firefox
Atom V 1.46.0,
open-in-browser V 0.5.2,
Windows 10 - Default browser - Chrome

For my experience (and of course with ubuntu), it would be nice to have the plugin "open-in-browsers" (reachable via "Edit"=>"Preferences"=>"Packages", v0.0.30 in my case) configure the Atom "config.cson" (reachable via "Edit"=>"Config...") like this:
"open-in-browsers":
Chrome:
path: "/snap/bin/chromium"
tooltip: "Chromium"
Firefox:
path: "/usr/bin/firefox"
tooltip: "Firefox"
FirefoxDeveloper:
path: "/usr/local/bin/firefox-dev"
tooltip: "Firefox Developer"
browsers: [
"Chrome"
"Firefox"
"FirefoxDeveloper"
]
defBrowser: "FirefoxDeveloper"
but that will not work.
With no better luck I tried [in "config.cson"]:
"open-in-browsers":
BrowserPlus: false
Chrome: false
ChromePortable:
path: "/snap/bin/chromium"
tooltip: "Chromium"
Firefox: false
FirefoxPortable:
path: "/usr/local/bin/firefox-dev"
tooltip: "Firefox Developer"
IE: false
Opera: false
Safari: false
SafariPortable:
path: "/usr/bin/firefox"
tooltip: "Firefox"
browsers: [
"ChromePortable"
"FirefoxPortable"
"SafariPortable"
]
defBrowser: "SafariPortable"
Now I have:
"open-in-browsers":
BrowserPlus: false
FirefoxPortable:
path: "/usr/local/bin/firefox-dev"
tooltip: "Firefox Developer"
IE: false
Opera: false
Safari: false
SafariPortable: {}
browsers: [
"Chrome"
"Firefox"
"FirefoxPortable"
]
defBrowser: "FirefoxPortable"
Chromium (via snap in ubuntu: /snap/bin/chromium) and Firefox (via ubuntu apt: /usr/bin/firefox) are working, Firefox Developer does not start at the moment, but did. Some update seems to have destroyed the link between Atom and Firefox Developer?!
It would be a good idea to fill the Wiki in https://github.com/skandasoft/open-in-browsers, for all platforms (MacOS, Linux, Windows).

Related

Not able to switch to iframe in chrome headless mode using selenium's driver.switchto.frame() in linux machine

I am not able to interact with iframes in CI which executes tests on a linux machine(Chrome headless) and same tests are passing in my local(chrome headless).
Error:
org.openqa.selenium.NoSuchFrameException: no such frame
(Session info: headless chrome=101.0.4951.54)
Build info: version: '4.1.4', revision: '535d840ee2'
System info: host: '6cca6d2f-cfcc-11ec-b9d8-ca14bbdd5338', ip: '10.0.34.39', os.name: 'Linux', os.arch: 'amd64', os.version: '5.4.117-58.216.amzn2.x86_64', java.version: '11.0.15'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [d24c23a90f2b60a590c341a83aa6199a, switchToFrame {id=0}]
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 101.0.4951.54, chrome: {chromedriverVersion: 101.0.4951.41 (93c720db8323..., userDataDir: /tmp/.com.google.Chrome.gFupg7}, goog:chromeOptions: {debuggerAddress: localhost:44285}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: LINUX, platformName: LINUX, proxy: Proxy(), se:cdp: ws://localhost:44285/devtoo..., se:cdpVersion: 101.0.4951.54, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:virtualAuthenticators: true}
Session ID: d24c23a90f2b60a590c341a83aa6199a
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:200)
at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:133)
at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:53)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:184)
at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:167)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:142)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:567)
at org.openqa.selenium.remote.RemoteWebDriver$RemoteTargetLocator.frame(RemoteWebDriver.java:1040)
at app.pageobject.cybersource.cards.CybersourceIframe.enterCardNumber(CybersourceIframe.kt:30)
at app.functions.webFunctions.CybersourceFunctions$getCybersourceExternalToken$2.invokeSuspend(CybersourceFunctions.kt:37)
Code Snippet
var windowHandle = driver.getWindowHandle(); // save the original window handle
wait.until(ExpectedConditions.frameToBeAvailableAndSwitchToIt(0))
val cardNumberIframe = driver.findElement(By.xpath("//input[#name='number']"))
fillText(cardNumberIframe, cardNumber)
driver.switchTo().window(windowHandle)
HTML for iframe:
enter image description here

Prtractor Error with Gitlab CI/CD Pipeline

We have a secured network and Protractor test suite runs locally. But when running the Gitlab CI/CD pipeline with headless chrome it returns network errors
This is my conf.js
exports.config = {
framework : "jasmine2",
multiCapabilities : [
{
browserName: "chrome",
chromeOptions: {
args: [
"--incognito",
"--headless",
"--no-sandbox",
"--disable-gpu",
"--window-size=1920,1080",
"--disable-dev-shm-usage",
"--allow-insecure-localhost"
],
},
},
],
specs: [
'./tests/sample.ts',
],
seleniumServerJar: '../node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.141.59.jar',
seleniumAddress: 'http://localhost:4444/wd/hub',
chromeDriver: './node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_98.0.4758.102',
directConnect: true,
onPrepare: function(){
void browser.manage().timeouts().implicitlyWait(10000);
void browser.waitForAngularEnabled(false);
require("ts-node").register({
project: require("path").join(__dirname, "./tsconfig.json"),
})
},
plugins: [{
package: 'protractor-screenshoter-plugin',
screenshotPath: './outputJS/reports/e2e',
screenshotOnExpect: 'failure+success',
takeScreenshots:'true',
withLogs: 'true',
writeReportFreq: 'asap',
imageToAscii: 'none',
clearFoldersBeforeTest: true
}]
}
Error appears
$ npm run e2e-headless-run
> e2e#1.0.0 e2e-headless-run /var/gitlab-runner/-8xgu1of/0/team-iron/ebba/pco-front-end/e2e
> node node_modules/protractor/bin/protractor ./headless_conf.js
[09:46:36] W/driverProviders - Using driver provider directConnect, but also found extra driver provider parameter(s): seleniumAddress, seleniumServerJar
[09:46:37] I/launcher - Running 1 instances of WebDriver
[09:46:37] I/direct - Using ChromeDriver directly...
Activated Protractor Screenshoter Plugin, ver. 0.10.3 (c) 2016 - 2022 [object Object] and contributors
Started
Creating reporter at ./outputJS/reports/e2e/
FF
Failures:
1) Google Sample Test loading web page
Message:
Expected '**Network Error**' to contain 'PCO'.
Stack:
Error: Failed expectation
at helper.verifyPageTitle (/var/gitlab-runner/-8xgu1of/0/team-iron/ebba/pco-front-end/e2e/helper/helper.ts:151:36)
at loginPage.verify_page_title (/var/gitlab-runner/-8xgu1of/0/team-iron/ebba/pco-front-end/e2e/pages/loginpage.ts:55:23)
I tried adding webDriverProxy and proxy. But same result appears.

How to configure Nightwatch.js with geckodriver to install metamask on browser startup

So we are trying to configure NightWatch so that the resulting opened firefox browser window, comes pre-installed with a extension (MetaMask) - so that tests can use Metamask to test out simple wallet transactions.
I'm fairly certain this is possible using geckodriver.
Our current nightwatch.conf.js file is:
const pathToGeckoDriver = require('geckodriver').path;
module.exports = {
src_folders: ['src/tests'],
page_objects_path: ['src/pages'],
custom_commands_path: ['src/custom-commands'],
webdriver: {
start_process: true,
server_path: pathToGeckoDriver,
},
test_settings: {
default: {
launch_url: 'https://some-website.com',
end_session_on_fail: false,
desiredCapabilities: {
browserName: 'firefox',
acceptInsecureCerts: true,
javascriptEnabled: true,
firefoxOptions: {
args: ['-profile', 'nightwatch'], // tried making a "nightwatch" profile for firefox and setting this profile at startup. no luck. :(
add_extension: ['metamask-10.2.2-an+fx.xpi'], // tried various versions of this line, no luck. :(
},
},
},
},
};
We have downloaded the extension XPI file and placed it in the same dir as the nightwatch.conf.js file.
Has anyone managed to get geckodriver to boot with an extension installed via Nightwatch config?

sublime text 3 anaconda stop working after restart

I have installed Anaconda package using package controle.
I have the following user settings for the package:
{
/*
No Autoformatting
*/
"auto_formatting": false,
"autoformat_ignore":
[
"E309",
"E501"
],
"pep8_ignore":
[
"E309",
"E501"
],
/*
No Linting (this is done by sublinter-flake8)
*/
"anaconda_linting": false,
"anaconda_linter_underlines": false,
"anaconda_linter_mark_style": "none",
"display_signatures": true,
/*
Use anaconda for code completion
Suppress sublime completions
*/
"disable_anaconda_completion": false,
"suppress_word_completions": true,
"suppress_explicit_completions": true,
"enable_signatures_tooltip" : true,
"merge_signatures_and_doc" : true,
/*
Others
*/
"complete_parameters": false
}
Right after installation The anaconda autocompletion works:
but after restart of sublime text 3 it stop working:
sublime text 3 version - 3.2.2 build 3211
could you please help to understand what I'm doing wrong or what settings need to add to make it working after restart?

Sauce Labs OnDemand: multiCapabilities build information is not accepted

We are running mocha nodejs tests with protractor on Sauce Labs and the attribute 'build' is being ignored. This is my protractor.conf.js
multiCapabilities: [
{
name: 'chrome-tests-windows',
browserName: 'chrome',
version: '52',
platform: 'Windows 7',
shardTestFiles: true,
maxInstances: 25,
build: 'solisko-1',
tags: ['tag1', 'tag2']
}]
When I look at the metadata in Sauce Labs Dashboard I see this:
Build null
Tags ["tag1","tag2"]
Browser googlechrome
Browser version 52.0.2743.82
OS Windows 2008
Any idea why the build name is ignored?
I guess, for the build to be populated on Sauce platform. You need to send the below property in Protractor config file. Check here
/** * Use sauceBuild if you want to group test capabilities by a
build ID */
sauceBuild?: string;
I dont see a build option in capabilities object as per the documentation here
From different source I found out that this is the correct attribute:
multiCapabilities: [
{
Build: 'some-build-name',
BuildName: 'some-build-name',
name: 'chrome-tests-mac',
browserName: 'chrome',
version: '52',
platform: 'OS X 10.12',
shardTestFiles: true,
maxInstances: 25
}
]

Resources