我正在使用 selenium 在 Web 应用程序中自动执行邮件验证过程。我已经有一个脚本可以登录到 gmail 并阅读帐户上收到的激活邮件。该脚本一直运行到昨天,但今天我遇到了一个问题。
问题的附加屏幕截图

如果浏览器使用 selenium 启动,则 Gmail 不允许登录。说,
您使用的是 Google 无法识别的浏览器,或者其设置方式我们不支持。
使用的软件:“webdriverio”:“^4.14.1”,“wdio-cucumber-framework”:“^2.2.8”
任何帮助表示赞赏。
我有一个 monorepo,我希望在其中创建一个脚本以在本地启动特定项目。
该项目是完全Node.js基于。
为了在本地设置此项目进行开发,我需要按以下顺序运行以下命令:
启动 docker 镜像
cd docker/dockerForTestsdocker-compose up -d启动 Web Auth 服务器
cd src/project/webAuthenticationsetenvs projectAuthentication && npm start启动 API
cd src/project/apisetenvs projectAPI && npm start启动网络客户端
cd src/project/websetenvs projectWeb && npm start为了便于使用,我通常在 VSCode 内的新终端窗口中启动每个部分。
为了自动化这个过程,我发现了 VSCode 任务。
虽然看起来它们是为“构建”或“观察”任务而设计的,但我认为我可以修改行为来为我运行上述命令。
这是我的尝试:
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"runner": "terminal",
"version": "2.0.0",
"tasks": [
{
"label": "Start Docker",
"dependsOrder": "sequence",
"type": "shell",
"command": "cd docker/dockerForTests && …Run Code Online (Sandbox Code Playgroud) node.js docker visual-studio-code vscode-settings vscode-tasks
我使用PUT命令成功更新了组件,之后 Strapi 抛出了错误:
错误:目标多态类型“components_COMPONENT_NAME”不是定义的目标类型之一
我用来更新 Strapi 组件的命令:
PUT http://localhost:1337/content-type-builder/components/COMPONENT_DIR.COMPONENT_NAME
{
"components": [],
"component": {
"category": "COMPONENT_DIR",
"icon": "biohazard",
"name": "COMPONENT_NAME",
"description": "",
"connection": "default",
"collectionName": "components_COMPONENT_DIR_COMPONENT_NAME",
"attributes": {
"type": {
"type": "string",
"default": ""
},
"uuid": {
"type": "string"
},
"title": {
"type": "text"
},
"description": {
"type": "text"
},
"banner_image": {
"type": "media",
"multiple": false
}
}
}
}
Run Code Online (Sandbox Code Playgroud) 我正在使用 rxjs 在我的 Angular 应用程序中使用 websocket。
我像这样实例化它:我想添加一些标题:
myheader : "abcde"
Run Code Online (Sandbox Code Playgroud)
我是怎么做的?
这是我的代码:
import { BehaviorSubject, of, Subscription, Subject, Observable, NextObserver } from 'rxjs';
@Injectable()
export class WebsocketService {
openConnection() {
this.close();
const url = 'wss://echo.websocket.org';
this.connection$ = webSocket({
url,
openObserver: this.openObserver,
closeObserver: this.closeObserver,
});
this.getmsg();
}
}
Run Code Online (Sandbox Code Playgroud)
建议?
屏幕截图演示了实时摄像机预览中的内部圆圈,它可以抓取颜色以及显示当前正在查看的像素颜色的外部圆圈.
我有实时相机预览使用叠加,但我不知道从屏幕上的特定位置抓取颜色从哪里开始.
我知道你可以拍照并抓住那种颜色,但这不是我追求的功能,我正在寻找能让我实时看到结果的东西.
可以实现此功能吗?如果是这样,我该怎么做?
我有一个基本的使用做出反应生成的应用程序:create-react-app。
我的源代码托管在GitHub上。
我希望使用Google Cloud Platform托管我的React应用程序。
(我也有一个自定义域)。
每次在master分支机构上更改推送/合并/代码时,我都希望GCP上的托管应用程序从中更新我的网站内容master。
以前,我一直未能遵循Google提供的说明来建立用于更新和部署我的应用程序的持续集成过程。
我使用Google Cloud Build GitHub应用程序尝试更新和构建应用程序,但没有成功。
我的cloudbuild.yaml文件包括:
steps:
- name: 'gcr.io/cloud-builders/npm'
args: ['install']
- name: 'gcr.io/cloud-builders/npm'
args: ['build']
Run Code Online (Sandbox Code Playgroud)
我还为存储桶设置了一个有效的appspot.comURL(已使用GCP网站上的内置控制台克隆并部署了该应用程序),该URL已映射到我的自定义域。
我尝试更新此已部署版本的尝试失败了。
为了尝试实现所需的工作流程而感到沮丧,我切换到Netlify,这使我得以实现自己想要的目标,并从GCP中删除了我的项目。
我现在正尝试从头开始(在GCP上)另一个项目,并且需要一些帮助以确保我正确设置了这个新项目,如果需要的话,还将提供逐步指南。在应用程序的生产级部署方面,我是一个完全新手,仅在自己的机器上进行实践并开发了“开发”级应用程序,而在其他任何地方都找不到能帮助我实现自己想做的事情的新手。
我试图实现的工作流程如下:
我怎样才能正确地做到这一点?还是GCP并不是理想的解决方案?
git deployment reactjs google-cloud-platform create-react-app
我有一个简单的组件,如下所示:
import React from "react";
import './MyContainer.css';
class MyContainer extends React.Component {
constructor(props) {
super(props);
this.state = {
};
}
showWhereClicked = (e) => {
console.log(`you have clicked X:${e.screenX} Y:${e.screenY}`);
// do stuff
}
render() {
return (
<div className="myContainer" onClick={this.showWhereClicked}>
I am 500px tall.
</div>
);
}
}
export default MyContainer;
Run Code Online (Sandbox Code Playgroud)
每当我点击里面的任何地方时<MyContainer />,我都会收到一条控制台消息,给出我在屏幕上点击的位置的 X 和 Y 坐标。
我希望<div>在鼠标单击的 X 和 Y 位置放置一个内部。理想情况下是一个盒子或其他东西,比如 100x100px 宽。
后来我想实现一种方法让我<div>在屏幕上自由移动这些组件。
我怎样才能做到这一点?
我想集成我们的 Jenkins 和 Kubernetes 集群,它们在不同的服务器上工作。我每个stage和2 个集群production。我已经在舞台集群上创建了 2 个命名空间来划分development和stage。我将我的 values.yaml 划分为如下所示。
所以根据 GIT_BRANCH 值;我想设置命名空间变量并通过helm install命令进行部署。在这种情况下,
我的问题是,在这种情况下,在 Jenkinsfile 中连接 2 个集群的最佳方法是什么,因为开发和测试命名空间我需要一个集群,生产我需要部署另一个集群。
stage('deploy') {
steps {
script {
if (env.GIT_BRANCH == "origin/master") {
def namepsace="dev"
sh "helm upgrade --install -f values.dev.yaml --namespace ${namespace}"
} else if (env.GIT_BRANCH =="origin/test"){
def namepsace="stage"
sh "helm upgrade --install -f values.stage.yaml --namespace ${namespace}"
} else {
def namepsace="prod"
sh "helm upgrade --install -f values.prod.yaml --namespace …Run Code Online (Sandbox Code Playgroud) 我是新用mongoDB,并NodeJS和我有我的树莓派这个错误。但是,我在 Ubuntu 上运行它时没有任何错误。
这是我的代码:
var MongoClient = require("mongodb").MongoClient;
MongoClient.connect("mongodb://localhost/logs",{useUnifiedTopology : true},function(error,db) {
if(error) throw(error);
console.log("connected");
});
Run Code Online (Sandbox Code Playgroud)
这是我得到的错误:
MongoServerSelectionError: Server at localhost:27017 reports maximum wire version 0, but this version of the Node.js Driver requires at least 2 (MongoDB 2.6)
at Timeout.waitQueueMember.timer.setTimeout [as _onTimeout] (/home/pi/monitoring/node_modules/mongodb/lib/core/sdam/topology.js:448:30)
at ontimeout (timers.js:436:11)
at tryOnTimeout (timers.js:300:5)
at listOnTimeout (timers.js:263:5)
at Timer.processTimers (timers.js:223:10)
Run Code Online (Sandbox Code Playgroud)
有谁知道如何解决版本问题?谢谢
我有一个包含多个 SAP 数据表和一个 SQL 语句的 SQL 数据库,如下所示:
SELECT DISTINCT
AFKO.PLNBEZ AS 'Material',
MAKT.MAKTX AS 'Material Number',
AFKO.AUFNR AS 'Order',
AFVC.VORNR AS 'Operation Number',
CRTX.KTEXT AS 'Operation Text',
AFVV.VGW01 AS 'Estimated Hours 1',
AFVV.VGW02 AS 'Estimated Hours 2',
AFVV.VGW03 AS 'Estimated Hours 3',
AFVV.VGW04 AS 'Estimated Hours 4',
AFVV.VGW05 AS 'Estimated Hours 5',
AFVV.VGW06 AS 'Estimated Hours 6',
AFVV.ISM01 AS 'Actual Hours 1',
AFVV.ISM02 AS 'Actual Hours 2',
AFVV.ISM03 AS 'Actual Hours 3',
AFVV.ISM04 AS 'Actual Hours 4',
AFVV.ISM05 AS 'Actual …Run Code Online (Sandbox Code Playgroud) javascript ×2
node.js ×2
reactjs ×2
angular ×1
automation ×1
camera ×1
cordova ×1
css ×1
database ×1
deployment ×1
docker ×1
git ×1
gmail ×1
ionic3 ×1
jenkins ×1
kubernetes ×1
mobile ×1
mongodb ×1
rxjs ×1
sap ×1
sql ×1
sql-server ×1
strapi ×1
vscode-tasks ×1
websocket ×1