I am testing my Expo (React native) app using Appium and Browser stack,
Following is my configuration for BrowserStack and Appium:
// ============
// Specs
// ============
config.specs = [
'./tests/specs/**/app*.spec.ts',
];
config.exclude = [
// Exclude this one because the test can only be executed on emulators/simulators
// './tests/specs/**/app.biometric.login.spec.ts',
];
// =============================
// Browserstack specific config
// =============================
// User configuration
config.user = process.env.BROWSERSTACK_USER || '$BROWSERSTACK_USERNAME';
config.key = process.env.BROWSERSTACK_ACCESS_KEY || '$BROWSERSTACK_ACCESS_KEY';
// Use browserstack service
config.services = ['browserstack'];
// ============
// Capabilities
// ============
// For all capabilities please check
// http://appium.io/docs/en/writing-running-appium/caps/#general-capabilities
config.capabilities = [
{
// Set your BrowserStack config
'browserstack.debug': true,
// Set URL of the application under test
app: process.env.BROWSERSTACK_ANDROID_APP_ID || getBrowserstackAndroidPath,
// Specify device and os_version for testing
device: 'Google Pixel 3',
os_version: '9.0',
// Set other BrowserStack capabilities
project: 'My-app',
build: 'android',
name: 'MyApp'
},
];
exports.config = config;
It is working fine with my local setup using Appium, but while run it in CI script, it gives following error,
invalid argument: Unsupported locator strategy: accessibility id
184 (Session info: chrome=100.0.4896.127)
185 (Driver info: chromedriver=100.0.4896.60 (6a5d10861ce8de5fce22564658033b43cb7de047-refs/branch-heads/4896#{#875}),platform=Linux 4.1.13-101.fc21.x86_64 x86_64)
Related
for example, how to log out debug info Hello world for
import * as log from "https://deno.land/std#0.173.0/log/mod.ts";
// Simple default logger out of the box. You can customize it
// by overriding logger and handler named "default", or providing
// additional logger configurations. You can log any data type.
log.debug("Hello world");
log.info(123456);
log.warning(true);
log.error({ foo: "bar", fizz: "bazz" });
log.critical("500 Internal server error");
from https://deno.land/std#0.173.0/log/mod.ts
I tried deno run -A --log-level=DEBUG with no luck.
for example, how to log out debug info Hello world for...
Below is an example of how you can configure all levels of logging to the console at "DEBUG" and above.
The module at https://deno.land/std#0.174.0/log/mod.ts includes some example code that looks just like the lines in your question (on lines 97-153 in the file) — it is what I used as a basis for the code below.
so-75244033.ts:
import * as log from "https://deno.land/std#0.174.0/log/mod.ts";
// This could be read from an environment variable or parsed from a CLI argument:
const LOG_LEVEL = "DEBUG";
log.setup({
handlers: {
console: new log.handlers.ConsoleHandler(LOG_LEVEL),
},
loggers: {
default: {
level: LOG_LEVEL,
handlers: ["console"],
},
},
});
// Simple default logger out of the box. You can customize it
// by overriding logger and handler named "default", or providing
// additional logger configurations. You can log any data type.
log.debug("Hello world");
log.info(123456);
log.warning(true);
log.error({ foo: "bar", fizz: "bazz" });
log.critical("500 Internal server error");
In the terminal:
% deno --version
deno 1.30.0 (release, x86_64-apple-darwin)
v8 10.9.194.5
typescript 4.9.4
% deno run so-75244033.ts
DEBUG Hello world
INFO 123456
WARNING true
ERROR {"foo":"bar","fizz":"bazz"}
CRITICAL 500 Internal server error
I'm using http://localhost:3000 to development my website, but I always get CROS error from Sentry, what am I missing?
in Sentry's Setting:
I've set the project's Allowed Domains to *, but it's looks like not work....
Access to fetch at 'my-sentry-dsn' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
Vue3 + Vite
yarn add #sentry/tracing #sentry/vue
in main.ts
import * as Sentry from "#sentry/vue"
import { Integrations } from "#sentry/tracing"
const app = createApp(App)
// Initialize Sentry
const dsnSentry = import.meta.env.VITE_SENTRY_DSN as string
if (!!dsnSentry) {
const env = import.meta.env.VITE_ENV
const isDebug = env !== "production"
Sentry.init({
app,
dsn: dsnSentry,
// integrations: [new Integrations.BrowserTracing()],
integrations: [
new Integrations.BrowserTracing({
routingInstrumentation: Sentry.vueRouterInstrumentation(router),
tracingOrigins: ["localhost:3000", /^\//],
}),
],
tracesSampleRate: 1.0,
debug: isDebug,
})
}
app.mount("#app")
I solved this problem by using * in the tracingOrigins param.
Like this:
Sentry.init({
dsn: "__DNS__",
integrations: [new BrowserTracing({ tracingOrigins: ["*"] })],
tracesSampleRate: 1.0,
});
Another problem, can be ads block extension like adblock, ublock.
I'm just getting started with next-offline and found the section regarding workbox integration and its recipes.
According to the docs:
If you're new to workbox, I'd recommend reading this quick guide --
anything inside of workboxOpts will be passed to
workbox-webpack-plugin.
Define a workboxOpts object in your next.config.js and it will gets
passed to workbox-webpack-plugin. Workbox is what next-offline uses
under the hood to generate the service worker, you can learn more
about it here.
After digging around, I found this great section.
Essentially it gives a suggestion to use two different options:
GenerateSW or InjectManifest
I would like to use the InjectManifest, however when I try to implement that in my next.config.js file. I get this error:
"runtimeCaching" is not a supported parameter.
This is my next.config.js:
const withCSS = require('#zeit/next-css');
const withSass = require('#zeit/next-sass');
const withImages = require('next-images');
const optimizedImages = require('next-optimized-images');
const withOffline = require('next-offline');
module.exports = withOffline(
withImages(
optimizedImages(
withCSS(
withSass({
// useFileSystemPublicRoutes: false,
// generateSw: false, // this allows all your workboxOpts to be passed in injectManifest
generateInDevMode: true,
workboxOpts: {
swDest: './service-worker.js', // this is the important part,
exclude: [/.+error\.js$/, /\.map$/, /\.(?:png|jpg|jpeg|svg)$/],
runtimeCaching: [
{
urlPattern: /\.(?:png|jpg|jpeg|svg)$/,
handler: 'CacheFirst',
options: {
cacheName: 'hillfinder-images'
}
},
{
urlPattern: /^https?.*/,
handler: 'NetworkFirst',
options: {
cacheName: 'hillfinder-https-calls',
networkTimeoutSeconds: 15,
expiration: {
maxEntries: 150,
maxAgeSeconds: 30 * 24 * 60 * 60 // 1 month
},
cacheableResponse: {
statuses: [0, 200]
}
}
}
]
},
dontAutoRegisterSw: false,
env: {
MAPBOX_ACCESS_TOKEN: process.env.MAPBOX_ACCESS_TOKEN,
useFileSystemPublicRoutes: false
},
webpack(config, options) {
config.module.rules.push({
test: /\.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/,
use: {
loader: 'url-loader',
options: {
limit: 100000,
target: 'serverless'
}
}
});
return config;
}
})
)
)
)
);
Also when I check the Application pane, in devTools I see this:
You'll notice what appears to me a duplication of fields i.e. https-calls and hillfinder-https-calls and images and hillfinder-images.
I thought the cacheName field in the options: {} in each was allowing one to include a custom name?
Just wondering if anyone has had experience setting this up?
Thank you in advance!
(These comments apply to the basic Workbox build tools, not specifically to the next-offline wrapper, but I think they're still accurate.)
If you're using InjectManifest mode, the idea is that you write all of your service worker logic, using the underlying pieces of Workbox that you need, following a model that's similar to what's described in the Getting Started guide. You should include a call to precacheAndRoute(self.__WB_MANIFEST) somewhere in your service worker, and then the InjectManifest build tool is responsible for swapping out self.__WB_MANIFEST with an array containing the list of URLs to precache, along with revision information for each URL.
The runtimeCaching parameter is not compatible with InjectManifest. It's a parameter that can be used in GenerateSW mode, in with the Workbox build tool creates an entire service worker for you (including runtime caching routes). The GenerateSW mode takes in a declarative configuration and spits out the code for service worker based on that configuration. If that sounds good—if you'd just like to configure some build options and get a complete service worker as a result—then using GenerateSW is the right choice.
I am using wordpress website Local by flywheel ( url: xyz.local ) . I created a new gatsby site using and added gatsby-source-woocommerce. I also generated consumer key and consumer secret from woo-commerce settings. i added them to the api_keys in the config file.
When i run gastby develop, i get this error.
========== WARNING FOR FIELD products ===========
The following error status was produced: Error: connect ECONNREFUSED 127.0.0.1:8080
================== END WARNING ==================
08:19:23.204Z > gatsby-source-woocommerce: Fetching 0 nodes for field: products
08:19:23.206Z > gatsby-source-woocommerce: Completed fetching nodes for field: products
warn
========== WARNING FOR FIELD products/categories ===========
The following error status was produced: Error: connect ECONNREFUSED 127.0.0.1:8080
================== END WARNING ==================
08:19:23.213Z > gatsby-source-woocommerce: Fetching 0 nodes for field: products/categories
08:19:23.215Z > gatsby-source-woocommerce: Completed fetching nodes for field: products/categories
warn
========== WARNING FOR FIELD products/attributes ===========
The following error status was produced: Error: connect ECONNREFUSED 127.0.0.1:8080
================== END WARNING ==================
Can someone pls say if did i miss anything? or any wrong i have done?
I solved it. Problem is with plugin.
In config options of gatsby-source-woocommerce,
comment everything after fields i.e After commenting it looks like,
{
resolve: "#pasdo501/gatsby-source-woocommerce",
options: {
// Base URL of Wordpress site
api: "wordpress.domain",
// set to false to not see verbose output during build
// default: true
verbose: true,
// true if using https. otherwise false.
https: false,
api_keys: {
consumer_key: <key>,
consumer_secret: <secret>,
},
// Array of strings with fields you'd like to create nodes for...
fields: ["products", "products/categories", "products/attributes"],
},
},
Head to the #pasdo501/gatsby-source-woocommerce folder ( node modules ) -> gatsby-node.js
change api_version = "wc/v3" to "wc/v2" and
change wpAPIPrefix = null to "wp-json"
and save it.
voila
no need to change the package. you can do this:
add /index.php to the end of api.
set wpAPIPrefix to wp-json.
set query_string_auth to true (I,m not sure if this one necessary).
{
resolve: '#pasdo501/gatsby-source-woocommerce',
options: {
api: 'pro.com/index.php',
https: true,
verbose: true,
api_keys: {
consumer_key: `ck_...........`,
consumer_secret: `cs_.................`,
},
fields: ['products', 'products/categories', 'products/attributes', 'products/tags'],
wpAPIPrefix: 'wp-json',
query_string_auth: true,
api_version: 'wc/v3',
// per_page: 100,
// encoding: 'utf8',
// axios_config: {}
}
}
I'm currently using Jovo for cross platform developing Alexa and Google Assistant's skills/actions.
I currently hit a roadblock in which I'm trying to get the previous intent by doing either:
this.user().context.prev[0].request.intent or
this.user().getPrevIntent(0).
But it hasn't worked. I get context is undefined and getPrevIntent doesn't exist. According to the Docs, I need to set up a table with DynamoDB (I did, and verified that it's working since Jovo is able to store the user object), and passed in the default configuration to App. But still can't seem to get it work. Any ideas?
const config = {
logging: false,
// Log incoming JSON requests.
// requestLogging: true,
/**
* You don't want AMAZON.YesIntent on Dialogflow, right?
* This will map it for you!
*/
intentMap: {
'AMAZON.YesIntent': 'YesIntent',
'AMAZON.NoIntent': 'NoIntent',
'AMAZON.HelpIntent': 'HelpIntent',
'AMAZON.RepeatIntent': 'RepeatIntent',
'AMAZON.NextIntent': 'NextIntent',
'AMAZON.StartOverIntent': 'StartOverIntent',
'AMAZON.ResumeIntent': 'ContinueIntent',
'AMAZON.CancelIntent': 'CancelIntent',
},
// Configures DynamoDB to persist data
db: {
awsConfig,
type: 'dynamodb',
tableName: 'user-data',
},
userContext: {
prev: {
size: 1,
request: {
intent: true,
state: true,
inputs: true,
timestamp: true,
},
response: {
speech: true,
reprompt: true,
state: true,
},
},
},
};
const app = new App(config);
Thanks 😊
To make use of the User Context Object of the Jovo Framework, you need to have at least v1.2.0 of the jovo-framework.
You can update the package to the latest version like this: npm install jovo-framework --save
(This used to be a comment. Just adding this as an answer so other people see it as well)