在我们正在开发的 React 应用程序中,我们使用 QA ID 进行 Selenium 测试。
将它们留在生产(实时)的代码库中是一种不好的做法吗?
如果是这样,为什么?难道只是为了尽量保持 TTFB(第一个字节的时间)低吗?
更多背景:
例如。
const automationTags = (givenTag) =>
(IS_PROD || !givenTag) ? {} : { 'data-qa': _.kebabCase(givenTag) }
Run Code Online (Sandbox Code Playgroud)
用法:
<Component {...automationTags(`${dataQa}-button`)} /><Component {...automationTags('profile-page-success-btn')} />... dataQaReact 组件中使用的 prop 在哪里。
我正在测试的代码工作正常,日志是正确的.
测试错误:ConnectorTest:无法初始化@Spy带注释的字段'entity'.
要测试的类别:
public class Connector {
private static final String hostname = "localhost";
private int varnishPort = 8000;
private int connectionTimeout = 5000; //millis
private int requestTimeout = 5000;
private int socketTimeout = 5000;
private final HttpHost host;
private HttpClient httpClient;
private HttpEntity entity;
private HttpResponse response;
public Connector(){
host = new HttpHost(this.hostname, this.varnishPort);
RequestConfig.Builder requestBuilder = RequestConfig.custom();
requestBuilder = requestBuilder.setConnectTimeout(connectionTimeout);
requestBuilder = requestBuilder.setConnectionRequestTimeout(requestTimeout);
requestBuilder = requestBuilder.setSocketTimeout(socketTimeout);
HttpClientBuilder builder = HttpClientBuilder.create();
builder.setDefaultRequestConfig(requestBuilder.build());
httpClient = builder.build();
}
public …Run Code Online (Sandbox Code Playgroud) HTTP动词PURGE是幂等的吗?如果我两次发送相同的PURGE请求,第二次会收到200吗?
我有一个微服务,可在将消息发布到Rabbit队列之前使Varnish缓存无效。在清除失败的情况下,我们需要记录并继续执行。
队列使用者必须从Varnish缓存中获取资源的最新状态。如果第一个微服务的第一次清除成功,是否会成功返回第二个微服务的新清除请求(实际从清漆请求资源之前)?
如何在GoLang中实现 MDC日志记录(Java)?
我需要在所有服务器日志中添加UUID,以便能够跟踪并发请求。
我必须为 websockets(扩散)使用非开源发布/订阅库,并且必须坚持使用特定版本,因为它是在服务器端使用的,我无法控制它。
问题是,在他们的代码库中的一个单独的 util 中,他们使用了保留关键字interface并触发了一个破坏构建的缩小错误:
Failed to minify the code from this file:
./node_modules/babel-loader/lib??ref--6-oneOf-2!./node_modules/diffusion/src/node_modules/util/interface.js:127
Read more here: bit.ly/CRA-build-minify
Run Code Online (Sandbox Code Playgroud)
我可以使用哪个正则表达式从缩小中排除此依赖项?
config.optimization.minimizer[0].options.exclude = /node_modules/; 不会将其排除在缩小之外。
config.optimization.minimizer[0].options.exclude = /^.*(node_modules|.js).*$/; 有效,但它太宽泛了
有关更多上下文,这是导致缩小失败的依赖项代码:
node_modules/diffusion/src/node_modules/util/interface.js
function _implements() {
var args = Array.prototype.slice.call(arguments, 0);
var impl = args.pop();
var unsatisfied = [];
...
// The joys of duck type. Quack quack
args.forEach(function(interface) { <<<<<<<<<<<<<<<<<<<<<
unsatisfied = unsatisfied.concat(interface(impl));
});
Run Code Online (Sandbox Code Playgroud)
这是 webpack 配置文件在我覆盖之前的样子:(我们不允许弹出)
"optimization": {
"minimizer": [
{
"options": {
"test": {
},
"extractComments": false, …Run Code Online (Sandbox Code Playgroud) According to the HAL standard (see here and here) the links to other resources should be placed in a specific embedded section.
So for instance this is not valid HAL, is my understanding correct?
{
"movies": [
{
"id": "123",
"title": "Movie title 1",
"_links": {
"subtitles": {
"href": "/movies/123/subtitles"
}
}
},{
"id": "456",
"title": "Movie title 2",
"_links": {
"subtitles": {
"href": "/movies/456/subtitles"
}
}
}
],
"_links": {
"self": {
"href": "/movies"
}
}
}
Run Code Online (Sandbox Code Playgroud)
The …
varnish ×2
go ×1
hateoas ×1
html ×1
http-method ×1
hypermedia ×1
javascript ×1
json ×1
mdc ×1
mockito ×1
purge ×1
rabbitmq ×1
reactjs ×1
regex ×1
rest ×1
selenium ×1
testing ×1
unit-testing ×1
webpack ×1