我希望通过Protractor-Cucumber测试创建JUnit样式的XML报告,以便CI可以使用它们。
关于如何实现这一目标,是否有任何详细的步骤?
从下面的链接获得了protractor-cucumber-junit npm库,但是文档并不详尽。
https://www.npmjs.com/package/protractor-cucumber-junit
该页面还指向一个更好的名为“ cucumberjs-junitxml”的插件。有关文档,请参见
https://github.com/sonyschan/cucumberjs-junitxml
这也不是很有帮助。
问题:
我使用这个命令来获取文档:
curl -XGET 'http://localhost:9200/flume-2016-08-19/_search?size=1'
Run Code Online (Sandbox Code Playgroud)
但我只得到这五个字段:“_index”、“_type”、“_id”、“_score”和“_source”。我如何获取“_version”字段?
我是硒的新手.
在我的应用程序中,它有几个选项卡,比如'AAA','ABC','ADF'; 我需要自动点击'ABC'标签.
这些标签有id,它们是'tab1','tab2','tab3'.我可以通过使用id轻松完成此操作.但我不想使用它,因为这些选项卡会不时更改.所以我需要在选项卡中使用该名称,因为它是唯一的.
请告诉我怎么做.
以下是我的标签:
<a id="tab2" class="current" onclick="expandcontent('sc2', this);" href="#"> ABC </a>
Run Code Online (Sandbox Code Playgroud)
谢谢
我是码头工人的新手;我有一个 docker-compose.yml 文件。我的问题是:如果我docker-compose up修改此文件后运行,这会删除旧的 postgres 数据库吗?
我的页面有一个包含11列的表,给出了第2列的文本值,我想点击同一行的第11列(箭头按钮).
我的DOM看起来像这样:
<table id=”atab” width=”100%” class=”at-class”>`
<thead>…</thead>
<tbody>
<tr>...</tr>
<tr>
<td>…</td>
<td>
<a href=”/abc/def/ghi/prop?id=1”>grp1</a>
</td>
<td>…</td>
<td>…</td>
<td>200</td>
<td>…</td>
<td>…</td>
<td>…</td>
<td>…</td>
<td>…</td>
<td>
<ul class=”dropwd”
<li class>
<input class=”a-act a-menu-button” type=”button” value=”^”
<ul class=”sub_menu” style=”vis””>…</ul>
</li>
</ul>
</td>
<tr>
<tbody>
Run Code Online (Sandbox Code Playgroud)
这个工作(因为我刚刚从inspect元素中获取了xpath).我不能用它.
myxpath = "//*[@id='atab']/tbody/tr[2]/td[11]/ul/li/input”
myxpath.click()
Run Code Online (Sandbox Code Playgroud)
我需要使用contains,然后抓住兄弟(第11个位置,从我拥有的第9个位置).我为myxpath尝试了以下内容,但它无法找到该元素.我在其他地方使用过相同的格式,很好.唯一的区别是这次,我没有得到相邻的兄弟,而是第x个兄弟姐妹.
哪里 campg = grp1
//table[@class='at-class']//td[contains(text(),' " + campg + " ')]/following-sibling::td[9]/ul/li/input
//* [@id='atab']//td[contains(text(),' " + campg + " ')]/following-sibling::td[9]/ul/li/input
//* [@id='campaigns']//td[contains(text(),' " + campg + " ')]/following-sibling::td[9]/ul/li/input[@type=’button’]
Run Code Online (Sandbox Code Playgroud)
我也尝试了其他组合.
import os
from os import path
import datetime
from datetime import date, time, timedelta
import time
def main():
# Print the name of the OS
print(os.name)
# Check for item existence and type
print("Item exists: " + (str(path.exists("textfile.txt"))))
#print("Item is a file: " + str(path.isfile("textfile.txt")))
#print("Item is a directory: " + str(path.isdir("textfile.txt")))
if __name__ == "__main__":
main()
Run Code Online (Sandbox Code Playgroud)
错误:
print("Item exists:"+(str(path.exists("textfile.txt"))))
TypeError:'str'对象不可调用
我使用以下来计算时间戳差异的年龄.
db.getCollection('person').aggregate( [
{ $project: {
item: 1,
DOB: "$personal.DOB",
dateDifference: { $subtract: [ new Date(), "$personal.DOB" ] }
} }
] )
Run Code Online (Sandbox Code Playgroud)
我得到了数值dateDifference.我希望通过将其除以(365*24*60*60*1000)将其转换为年.但我不知道如何在上面的查询中指定这个公式.我尝试了以下,但它没有返回任何值
db.getCollection('person').aggregate( [
{ $project: {
item: 1,
DOB:"$personal.DOB",
dateDifference: ({ $subtract: [ new Date(), "$personal.DOB" ] })/(365*24*60*60*1000)
} }
] )
Run Code Online (Sandbox Code Playgroud)