Automated tests 空手道-如何在深度放置的跨距标签中匹配测试
我正在使用空手道,我正在寻找如何在深度跨度中匹配价值的方法 我有这个案子:Automated tests 空手道-如何在深度放置的跨距标签中匹配测试,automated-tests,karate,Automated Tests,Karate,我正在使用空手道,我正在寻找如何在深度跨度中匹配价值的方法 我有这个案子: ... <form action="#"> <div class="row"> <div class="col-lg-12"> <div class="card shadow mb-4"> <div class="card-header py-3 d-flex flex-row align-items-center justi
...
<form action="#">
<div class="row">
<div class="col-lg-12">
<div class="card shadow mb-4">
<div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
<div class="card-body">
<p>...</p>
<div class="form-group " style="display: grid; grid-template-rows: auto auto;">
<span>
<label for="title">Title</label>
<input name="title" id="title" class="form-control" placeholder="e.g. My MacBook Key" value="">
</span>
<span class="invalid-feedback">Title is required</span>
</div>
<div class="form-group " style="display: grid; grid-template-rows: auto auto;">
<span>
<label for="key">Key</label>
<textarea name="key" id="key" class="form-control" rows="12" placeholder="Typically starts with "ssh-rsa" or "ssh-ed25519""></textarea>
</span>
<span class="invalid-feedback">Key is required</span>
或
知道如何在不使用完整xpath的情况下解决它吗
谢谢。有一种非常简单的方法:
* def messages = scriptAll('.invalid-feedback', '_.innerHTML')
* match messages[1] == 'Key is required'
* match text('{span:2}.invalid-feedback') == 'Key is required'
* def messages = scriptAll('.invalid-feedback', '_.innerHTML')
* match messages[1] == 'Key is required'