I am currently facing issue while trying achieve execution of Chrome Browser and Appium execution from browser stack from a single spec file
Below is the code written with multiple capabilities
Attaching log screensot
require('dotenv').config();
require('ts-node').register({ transpileOnly: true });
import { baseConfig as config } from '../test-android-e2e/config/wdio.base.android.conf';
import { baseConfig as configChrome } from '../test-wms-e2e/config/wdio.base.conf'; // inherits base config file
require('ts-node').register({ transpileOnly: true });
import _ from 'lodash';
import os from 'os';
import { TimelineService } from 'wdio-timeline-reporter/timeline-service';
let suiteName = '';
const overrides = {
updateJob: false,
specs: ['./test/specs/**/*.ts'],
specFileRetries: 4,
runner: process.env.RUNNER,
connectionRetryCount: 3,
framework: process.env.FRAMEWORK,
waitforTimeout: 10000,
connectionRetryTimeout: 90000,
exclude: [],
// ...
user: process.env.BROWSERSTACK_USER,
key: process.env.BROWSERSTACK_ACCESSKEY,
services: ['browserstack', [TimelineService], 'chromedriver'],
reporters: [
[
'allure',
{
outputDir: 'allure-results',
disableWebdriverStepsReporting: true,
disableWebdriverScreenshotsReporting: true,
},
],
['timeline', { outputDir: 'screenshots' }],
],
capabilities: {
Android: {
capabilities: [
{
'platformName': 'Android',
'appium:deviceName': 'Samsung Galaxy S21',
'appium:platformVersion': '11.0',
'appium:app': 'sampleid',
'bstack:options': {
'projectName': 'test-android-e2e',
idleTimeout: '300',
},
/* this locale will set device default location as US.
However it does not update language. Hence added separate capability for language */
'appium:locale': 'En-US',
'appium:language': 'En',
},
],
},
Chrome: {
capabilities: [
{
browserName: 'chrome',
'goog:chromeOptions': {
args: [
// 'user-agent=e2e-agent',
// '--headless',
'--disable-dev-shm-usage', // Force Chrome to use the /tmp directory instead. This may slow down the execution though.
'--disable-gpu',
'--no-sandbox',
'--window-size=1920,1080',
'--verbose',
'--trace-startup=-*,disabled-by-default-memory-infra',
'--trace-startup-file=/screenshots/trace.json',
'--trace-startup-duration=7',
],
},
},
],
},
// path: '/',
},
};
// Send the merged config to wdio
exports.config = _.defaultsDeep(overrides, config);
exports.config = _.defaultsDeep(overrides, configChrome);
Screenshot 1
Screenshot 2
I am trying to install rabbitmq:8.6.1 from bitnami chart repository using terraform:0.12.18.
My helm version is 3.4.2
while installing I am getting following error
Error: validation: chart.metadata is required
My terraform file is as below
resource "kubernetes_secret" "rabbitmq_load_definition" {
metadata {
name = "rabbitmq-load-definition"
namespace = kubernetes_namespace.kylas_sales.metadata[0].name
}
type = "Opaque"
data = {
"load_definition.json" = jsonencode({
"users": [
{
name: "sales",
tags: "administrator",
password: var.rabbitmq_password
}
],
"vhosts": [
{
name: "/"
}
],
"permissions": [
{
user: "sales",
vhost: "/",
configure: ".*",
write: ".*",
read: ".*"
}
],
"exchanges": [
{
name: "ex.iam",
vhost: "/",
type: "topic",
durable: true,
auto_delete: false,
internal: false,
arguments: {}
}
]
})
}
}
resource "helm_release" "rabbitmq" {
chart = "rabbitmq"
name = "rabbitmq"
version = "8.6.1"
timeout = 600
repository = "https://charts.bitnami.com/bitnami"
namespace = "sales"
depends_on = [
kubernetes_secret.rabbitmq_load_definition
]
}
After looking issue(509) at terraform-provider-helm,
If your module/subdirectory name is same as your chart name (In my case directory name is rabbitmq and my helm_resource name is also same rabbitmq), so I am getting this error, still not able to identify why, With reference to,
Solution: I change my directory name from rabbitmq to rabbitmq-resource and this error is gone.
Cron usually worked in the strapi-3.0.0-beta.20 version
but It doesn't work after migrating to version strapi-3.0.0
Strapi-3.0.0-beta.20
./config/environments/{env}/server.json
{
"host": "0.0.0.0",
"port": 1337,
"proxy": {
"enabled": false
},
"cron": {
"enabled": true
},
"admin": {
"autoOpen": false
}
}
Strapi-3.0.0
./config/server.js
module.exports = ({ env }) => ({
host: '0.0.0.0',
port: env.int('PORT', '1337'),
production: env('NODE_ENV') === 'production' ? true : false,
proxy: {
enabled: false
},
cron: {
enabled: true
},
admin: {
autoOpen: false
}
})
This is strapi code that uses the server.js
strapi/packages/strapi/lib/middlewares/cron/index.js
if (strapi.config.get('server.cron.enabled', false) === true) {
_.forEach(_.keys(strapi.config.get('functions.cron', {})), task => {
cron.scheduleJob(task, strapi.config.functions.cron[task]);
});
This is the content registered in the github issue.
Describe the bug
Incorrect information in documentation for new configuration loader
Expected behavior
There is a possibility of misunderstanding in the document regarding the cron setting.
This is a setting to activate cron (3.0.0.beta.20)
./config/environments/{env}/server.json
{
"host": "0.0.0.0",
"port": 1337,
"cron": {
"enabled": true
}
}
The documentation on how to migrate guides like this.
Migrating
Server
Your server configuration can move from ./config/environments/{env}/server.json to
./config/server.js like shown here.
Server
Available options -> cron
However, to enable cron in version 3.0.0 must do it in the middleware.js
./config/middleware.js
timeout: 100,
load: {
before: ['responseTime', 'logger', 'cors', 'responses', 'gzip'],
order: [
"Define the middlewares' load order by putting their name in this array is the right order"
],
after: ['parser', 'router']
},
settings: {
...
cron: { enabled: true }
...
}
Code snippets
After checking the code (strapi/middlewares/index.js), I learned that it should be set in middleware.
System
- Node.js version: v12.14.0
- NPM version: 6.13.6
- Strapi version: 3.0.0
- Database: mongodb
- Operating system: window, linux
Whenever I select a language in my application, it saves this parameter in the "lang" cookie, but accessing the root (http://localhost) without the language path (http://localhost/en) it loads the default language "pt", even the cookie set in another language "en" or "es". This is normal? Or is there any configuration for this type of situation?
[
'nuxt-i18n',
{
locales: [
{
code: 'en',
file: 'en.js'
},
{
code: 'es',
file: 'es.js'
},
{
code: 'pt',
file: 'pt.js'
}
],
lazy: true,
langDir: 'lang/',
parsePages: false,
strategy: 'prefix',
defaultLocale: 'pt',
rootRedirect: 'pt',
detectBrowserLanguage: {
useCookie: true,
cookieDomain: null,
cookieKey: 'lang',
alwaysRedirect: false,
fallbackLocale: 'pt'
},
}
]
Method change lang:
changeLanguage(lang) {
this.locale = lang
this.$i18n.setLocale(lang)
this.$moment.locale(lang);
},
I found that I needed to set the alwaysRedirect parameter to true, it forces the redirect by the cookie.
detectBrowserLanguage: {
alwaysRedirect: true
},
I'm developing a full-stack application using Vue-CLI 3. The backend is written in TypeScript and so requires compilation etc. Currently I'm just using ts-node to run the backend app directly which works, but it would be much cleaner if I could also webpack the backend app to give a single server.js rather than multiple sprawling typescript files all over the place.
The problem is that the way I'd do this normally is have a single webpack.base.js and then include that in different webpack config files. I can't really do that because a lot of the webpack configuration is hidden away in vue-cli-service
Ended up pretty much having a base webpack config and extending client and server webpack configuration.
My app root webpack.config.js looks like this:
const { config: client } = require('./src/client/webpack.config');
const { config: server } = require('./src/server/webpack.config');
/**
* Webpack Build File
*
* This webpack configuration is used for only building the client and server
* bundles. It imports both of these from their respective directories, but
* allows for overrides if required.
*
* Other dev tools such as watching, hot module reloading etc. has been split
* out into other config files
*
* #param {object} env Webpack `env` object
*/
module.exports = ({ mode = 'development' } = {}) => ([
{
...client({ mode }, process.env),
},
{
...server({ mode }, process.env),
},
]);
My src/client/webpack.config.js looks like this:
const { resolve: _resolve, sep } = require('path');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const TSConfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const HtmlWebpackRootElementPlugin = require('html-webpack-root-plugin');
const VueLoaderPlugin = require('vue-loader/lib/plugin');
const { DefinePlugin } = require('webpack');
const paths = {
src: {
rootDir: _resolve(__dirname) + sep,
app: _resolve(__dirname, 'app') + sep,
},
dist: {
rootDir: _resolve(__dirname, '..', '..', 'dist'),
app: _resolve(__dirname, '..', '..', 'dist', 'public'),
},
};
/**
* Client webpack build configuration.
*
* This webpack config produces a bundle for the client-side application only.
*
* #param {object} webpackEnv Webpack env object (basically any/all options passed in via the CLI)
* #param {object} processEnv Process env object (environment variables from process.env)
*/
const config = ({ mode = 'none' }, { APP_NAME = '', BASE_URL = '/' } = {}) => ({
name: 'client',
target: 'web',
mode,
entry: {
app: paths.src.app + 'main.ts',
},
output: {
path: paths.dist.app,
},
optimization: {
runtimeChunk: 'single',
},
resolve: {
extensions: ['.ts', '.js', '.vue'],
plugins: [
new TSConfigPathsPlugin({
configFile: paths.src.rootDir + 'tsconfig.json',
}),
],
},
context: paths.src.rootDir,
module: {
rules: [
{
test: /\.tsx?$/,
include: paths.src.rootDir,
exclude: /node_modules/,
use: [
{
loader: 'ts-loader',
options: {
happyPackMode: true,
},
},
],
},
{
test: /\.vue$/,
loader: 'vue-loader',
},
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
},
},
{
test: /\.s?[ac]ss$/,
use: [
'style-loader',
'css-loader',
'sass-loader',
],
},
{
test: /\.(png|jpe?g|gif|svg|eot|ttf|woff|woff2)$/i,
loader: 'file-loader',
options: {
name: 'assets/[name].[hash].[ext]',
esModule: false,
},
},
],
},
plugins: [
new CleanWebpackPlugin(),
new HtmlWebpackPlugin({
favicon: paths.src.app + 'assets/logo.png',
title: APP_NAME,
}),
new HtmlWebpackRootElementPlugin('app'),
new VueLoaderPlugin(),
new DefinePlugin({
'process.env.BASE_URL': JSON.stringify(BASE_URL),
}),
],
});
module.exports = {
config,
paths,
};
and my src/server/webpack.config.js looks like this:
const { resolve: _resolve, sep } = require('path');
const TSConfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
const nodeExternals = require('webpack-node-externals');
const { IgnorePlugin } = require('webpack');
const paths = {
src: _resolve(__dirname) + sep,
dist: _resolve(__dirname, '..', '..', 'dist'),
};
/**
* NestJs uses a custom wrapper around require() that allows it to show a
* warning when some extra package needs to be installed. This causes problems
* with webpack, so we're blacklisting packages we're not using with the
* IgnorePlugin below.
*
* To de-blacklist a package, just remove it from this array.
*/
const nestBlacklist = [
'^cache-manager$',
'^#nestjs/microservices$',
// packages below are required from microservices
'^amqp-connection-manager$',
'^amqplib$',
'^grpc$',
'^mqtt$',
'^nats$',
'^redis$',
];
/**
* Server webpack build configuration.
*
* This webpack config produces a bundle for the server-side application only.
*
* #param {object} webpackEnv Webpack env object (basically any/all options passed in via the CLI)
* #param {object} processEnv Process env object (environment variables from process.env)
*/
const config = ({ mode = 'none' }) => ({
name: 'server',
mode,
target: 'node',
entry: paths.src + 'main.ts',
externals: [nodeExternals()],
output: {
path: paths.dist,
filename: 'server.js',
},
resolve: {
extensions: ['.ts', '.js'],
plugins: [
new TSConfigPathsPlugin({
configFile: './tsconfig.build.json',
}),
],
},
context: paths.src,
optimization: {
minimize: false,
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
},
},
{
test: /\.ts$/,
include: paths.src,
exclude: /node_modules/,
use: [
{
loader: 'ts-loader',
options: {
happyPackMode: true,
},
},
],
},
],
},
plugins: [
new IgnorePlugin({
contextRegExp: /#nestjs/,
resourceRegExp: new RegExp(nestBlacklist.join('|')),
}),
],
node: {
__dirname: false,
},
});
module.exports = {
config,
paths,
};
This allows me to have distinct server and client side compilation configuration, but in such a way that's re-usable in other configurations. So, for webpack dev server - I have webpack.dev.config.js which contains the following:
const client = require('./src/client/webpack.config');
const server = require('./src/server/webpack.config');
const { HotModuleReplacementPlugin } = require('webpack');
const {
SERVER_PORT = 3000,
} = process.env;
/**
* Watch settings are the same between client and server, so we're keeping them
* here for consistency
*/
const watchConfig = {
watch: true,
watchOptions: {
ignored: /node_modules/,
},
};
/**
* Development Webpack Build File
*
* This webpack configuration extends `webpack.config.js` and builds on it to
* provide hot module replacement, watch moide and a dev server for the
* client-side code
*
* Other dev tools such as watching, hot module reloading etc. has been split
* out into other config files
*
* #param {object} env Webpack `env` object
*/
module.exports = ({ mode = 'development' } = {}) => ([
{
...client.config({ mode }, process.env),
...watchConfig,
devServer: {
contentBase: client.paths.dist.app,
historyApiFallback: {
rewrites: [
{ from: /./, to: '/index.html' },
],
},
port: 8000,
host: '0.0.0.0',
hot: true,
hotOnly: true,
proxy: {
'/api': `http://localhost:${SERVER_PORT}/`,
},
},
},
{
...server.config({ mode }, process.env),
...watchConfig,
plugins: [
...server.config({ mode }, process.env).plugins,
new HotModuleReplacementPlugin(),
],
},
]);
This config provides a setup that produces a server.js which then serves up a directory (in this case '/public'`) as it's static files dir.