How do I get protractor to accept the browser local camera - angularjs

I've been trying to get protractor to accept the browser local camera by using
browser.actions().sendKeys(protractor.Key.TAB, protractor.Key.TAB, protractor.Key.ENTER).perform();
This tabs to the accept button properly, but the enter key never gets submitted. I've also tried using
browser.actions().sendKeys(protractor.Key.TAB, protractor.Key.TAB).perform();
browser.actions().sendKeys(protractor.Key.ENTER).perform();
thinking that maybe enter needed to be on it's own line.
Any ideas on this?

You can try to manipulate the question popup using switchTo(), but I am afraid this is not going to work since this is a native chrome popup and not a javascript alert:
browser.driver.switchTo().alert().accept();
Here are the options (not tested yet):
start chrome with disable-web-security argument set in chromeOptions:
chromeOptions: {
args: [
'disable-web-security'
]
}
start chrome with use-fake-ui-for-media-stream argument:
chromeOptions: {
args: [
'use-fake-ui-for-media-stream'
]
}
add your site to the VideoCaptureAllowedUrls list (taken from here)
chromeOptions: {
prefs: {
'VideoCaptureAllowedUrls': ['http://my_url']
}
}
Also, have you tried pressing TAB 3 times?
browser.actions().sendKeys(protractor.Key.TAB, protractor.Key.TAB, protractor.Key.TAB, protractor.Key.ENTER).perform();

Try this:
capabilities: {
'browserName': 'chrome',
'chromeOptions': {
args: ['--use-fake-device-for-media-stream','--use-fake-ui-for-media-stream'],
}
},

Related

classname not showing on nextjs

So I was working on Login page using next.js as framework.
I did some simple designs using react for some texts but it is not showing on browser. It may be that it is not imported.
I don't see any error on console so I'm having trouble with finding what the problem is.
I can check on the inspector the classnames for these texts so I'm really puzzled why this is not reflected on the browser.
Does anyone know what the problem is or have had the same experience?
Thank you in advance.
the files looks like this:
It is my belief that the problem lies with your Tailwind installation. Kindly verify that Tailwind is installed correctly. On occasion, issues such as this can arise due to an issue with the Tailwind configuration file (tailwind.config.js). If the content routes are not added correctly, it may work in some components but not others.
content: [
"./components/**/*.{js,ts,jsx,tsx}",
"./widgets/**/*.{js,ts,jsx,tsx}",
"./shared/**/*.{js,ts,jsx,tsx}",
"./pages/**/*.{js,ts,jsx,tsx}",
"./components/**/*.{js,ts,jsx,tsx}",
"./hook/**/*.{js,ts,jsx,tsx}",
],
Configure your template paths
Add the paths to all of your template files in your tailwind.config.js file.
/** #type {import('tailwindcss').Config} */
module.exports = {
content: [
"./app/**/*.{js,ts,jsx,tsx}",
"./pages/**/*.{js,ts,jsx,tsx}",
"./components/**/*.{js,ts,jsx,tsx}",
// Or if using `src` directory:
"./src/**/*.{js,ts,jsx,tsx}",
],
theme: {
extend: {},
},
plugins: [],
}

cannot query field "allMdx" on type "Query"

I'm new in GraphiQl, I'm flowing tutorials from here
And also I'm new to Gatsby, after all requirement plugin install (guide from gatsby offical doc) when I want to go on this link: http://localhost:8000/___graphql then show me an error on allMdx if I hover on it.
like this:
but official document everything is ok, I don't know where is my problem.
any update issue!
I have used gatsby v3
also my initial query not match with this
Any suggestion please.
Basically, the GraphQL playground (localhost:8000/___graphql) is telling you that you have no allMdx node created. The list of all available nodes are in the left column (allFile, allDirectory, etc).
You need to set the filesystem to allow Gatsby to inferr that nodes by:
npm install gatsby-source-filesystem
Then, in your gatsby-config.js:
module.exports = {
siteMetadata: {
title: "My First Gatsby Site",
},
plugins: [
"gatsby-plugin-gatsby-cloud",
"gatsby-plugin-image",
"gatsby-plugin-sharp",
{
resolve: "gatsby-source-filesystem",
options: {
name: `blog`,
path: `${__dirname}/blog`, // <-- the folder where you have the .mdx files
}
},
],
};
If you have some MDX files in /blog folder, Gatsby will generate the proper nodes (allMdx), allowing you to query them.
Restart and clean your server by gatsby clean && gatsby develop.
The next steps are related to query the data by adding some configuration such as:
{
resolve: `gatsby-plugin-mdx`,
options: {
defaultLayouts: {
posts: require.resolve("./src/components/blog-layout.js"),
default: require.resolve("./src/components/layout.js"),
},
},
},
Note: you'll need to install the gatsby-plugin-mdx plugin first
You can check the following tutorial: https://www.digitalocean.com/community/tutorials/gatsbyjs-mdx-in-gatsby
Remember to clean cache (gatsby clean) in each trial and to stop and re-run de develop.

Websockets, truffle, ganache and react setup issues connection not open on send()

Sometimes I refresh, and it works. Sometimes it just doesn't work.
I tried changing ganache GUI settings to use port 8545 which I read is the WebSockets port but it still won't connect. ws:127.0.0.1 won't work and neither will http://
This is my truffle config file. The rest of the code is large and won't help much.
// See <http://truffleframework.com/docs/advanced/configuration>
// #truffle/hdwallet-provider
// var HDWalletProvider = require("truffle-hdwallet-provider");
const path = require("path");
var HDWalletProvider = require("#truffle/hdwallet-provider");
module.exports = {
// See <http://truffleframework.com/docs/advanced/configuration>
// to customize your Truffle configuration!
// contracts_directory: "./allMyStuff/someStuff/theContractFolder",
contracts_build_directory: path.join(__dirname, "/_truffle/build/contracts"),
// migrations_directory: "./allMyStuff/someStuff/theMigrationsFolder",
networks: {
ganache: {
host: "127.0.0.1",
port: 7545,
//port: 8545,
network_id: 5777,
//network_id: "*", // Match any network id,
websockets: false, // websockets true breaks TODO: connection not open on send()
// wss
},
},
};
This is some of my code on the actual screen in question.
const options = {
web3: {
block: false,
fallback: {
type: 'ws',
//url: 'ws://127.0.0.1:8546',
url: 'http://127.0.0.1:7545',
},
},
contracts: [MyStringStore],
// polls: {
// accounts: IntervalInMilliseconds,
// },
events: {},
};
I don't understand why sometimes it works and I can see drizzle state and sometimes I can't. React native and web3 is very new to me.
I get errors like this:
00:06 Contract MyStringStore not found on network ID: undefined
Error fetching accounts:
00:06 connection not open
I am having real difficulty setting up drizzle as well. One thing I see is that your
url: 'http://127.0.0.1:7545',
For some reason Drizzle only works with 'ws' as the prefix for such a URL. I am trying to follow this guide by people who got it working.
I think websocket is only available in the command line version.
Try install and use ganache-cli instead of the gui version.

Problems of preloading fonts and images using gatsby and netlify

I am keep getting the warning message of my website: https://www.selectchu.com
chrome warning message
"The resource was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate as value and it is preloaded intentionally."
The resource https://www.selectchu.com/component---src-pages-index-js-e3609fd82d452154463c.js was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate as value and it is preloaded intentionally.
The resource https://www.selectchu.com/google-fonts/s/roboto/v19/KFOmCnqEu92Fr1Mu4mxK.woff2 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate as value and it is preloaded intentionally.
The resource https://www.selectchu.com/app-97f530f3e5a7162dfd06.js was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate as value and it is preloaded intentionally.
The resource https://www.selectchu.com/webpack-runtime-c108f36890d85c65bb96.js was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate as value and it is preloaded intentionally.
what can be the main problem? and how to solve it?
I've tried to add as attribute on helmet plugin such as
const Font = 'public/google-fonts/s/roboto/v19/KFOmCnqEu92Fr1Mu4mxK.woff2'
require("dotenv").config({
path: `.env.${process.env.NODE_ENV}`,
})
module.exports = {
siteMetadata: {
title: `SelectChu`,
description: `Upcoming SelectChu project`,
author: `#Hogyster`,
},
plugins: [
`gatsby-plugin-react-helmet`,
{
resolve: 'gatsby-plugin-netlify',
options: {
allPageHeaders: [`Link: <${Font}>; rel=preload; as=font; type=font/woff2 crossorigin=anonymous`],
},
this is my gatsby-config.js
plugins: [
`gatsby-plugin-react-helmet`,
`gatsby-plugin-styled-components`,
`gatsby-transformer-sharp`,
`gatsby-plugin-sass`,
`gatsby-plugin-sharp`,
`gatsby-plugin-transition-link`,
{
resolve: `gatsby-plugin-prefetch-google-fonts`,
options: {
fonts: [
{
family: `Noto Sans KR`,
subsets: [`latin`, 'korean'],
variants: [`400`, `700`]
},
{
family: `Open Sans`,
variants: [`400`, `700`]
},
{
family: `Roboto`,
variants: [`400`, `700`]
},
],
},
},
'gatsby-transformer-remark',
}

automation test using protractor with browserstack does't work with mobile browsers

I tried to set up test using angular protractor. It works fine when I use browsers of desktops, But failed with mobile browsers.
Here is the set of protractor.
seleniumAddress: 'http://hub.browserstack.com/wd/hub',
capabilities: {
'browserstack.user' : 'user',
'browserstack.key' : 'key',
'browserstack.debug': 'true',
'browserstack.local' : 'true',
'platform' : 'MAC',
'device' : 'iPad mini Retina'
},
And I got the error like this in the log of browserstack when using iphone:
<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>6A1E5288B65A8A2C</RequestId>
<HostId>
ixGtp6t7yQWYa7cjkNqmaXLEHTXeKklSkf+Jmg9vnA/a+RYUfzUhJuNykqKAwOuoA3o1eQA9M9c=
</HostId>
</Error>
Error like this when using andriod
01:23 0 Injecting JavaScript-argsbodyscriptreturn (function () { var el = document.querySelector(arguments[0]); var callback = arguments[1]; try { angular.element(el).injector().get('$browser'). notifyWhenNoOutstandingRequests(callback); } catch (e) { callback(e); } }).apply(null, arguments);⇒
**This is feature will be implemented soon!**
Any one can give me some ideas about this?
You need to supply username and API key in request URL.
In your code:
http://hub.browserstack.com/wd/hub
It should be:
http://[username]:[api_key]#hub.browserstack.com/wd/hub
without [] brackets.
Also, you can read browserstack document for further understanding. https://www.browserstack.com/automate/ruby

Resources