首页 \ 问答 \ Webdriverio(WDIO)和基于Tag的Cucumber浏览器(Webdriverio (WDIO) and Cucumber Browser based on Tag)

Webdriverio(WDIO)和基于Tag的Cucumber浏览器(Webdriverio (WDIO) and Cucumber Browser based on Tag)

如何设置WDIO基于黄瓜标记在特定浏览器上运行方案。 我想我可以通过关闭现有的浏览器实例然后在场景钩子之前在黄瓜中打开一个新的浏览器实例来做到这一点,但这样做效率不高。


How would one setup WDIO to run a scenario on a specific browser based on a cucumber tag. I think I can do it by closing the existing browser instance and then opening a new browser instance in a cucumber before scenario hook, but that is not efficient.


原文:https://stackoverflow.com/questions/40988710
更新时间:2023-05-18 07:05

最满意答案

序列容器

您可以将序列容器看作是“从头开始构建”的容器。 它们使用不同的结构来保存数据,并具有不同的算法时间来插入,删除和检索元素。

您可以在此处找到有关容器算法时间的大量信息

容器适配器

容器适配器的行为被添加到序列容器上,使得它们尊重不同的范例。 增加的行为可能是一个更严格的行为(堆栈将只允许你弹出/推动项目,没有随机插入)。 他们是其他类型的容器,不需要新的存储行为,那些已经存在的容器。 作为示例, 可以在向量构建堆栈。 然后,它会使用vector的数据结构,但将使用限制在一组函数中以模仿堆栈。

最重要的是确保您使用合适的容器来满足您的需求。 更严格的容器将有助于防止数据误用,并了解数据的使用情况将有助于您选择好的容器以获得最佳性能。

有关容器适配器的更多信息可以在这里找到

大部分时间我应该使用什么?

许多专家(Scott Meyer,Bjarne Stroustrup)建议默认使用该vector ,而其他人(如Herb Sutter,如Steve Jessop指出的那样)则暗示了deque 。 我强烈建议你选择最适合你需要的容器。


Sequence containers

You could see sequence container as containers "built from scratch". They use different structures to hold data and have different algorithmic time to insert, delete and retreive element.

You can find a lot of information about the algorithmic time of containers here

Container adapters

Container adapters are behavior added over sequence containers making them respect different paradigms. The added behavior can be a stricter behavior (the stack will only allow you to pop/push item on it, no random insert). They are other type of containers that did not need a new storing behavior then those already existing. As an example, a stack could be built over a vector. It would then uses the data structure of vector, but restrain the usage to a certain set of functions to mimic a stack.

Most important over all this is to make sure that you use the right container to suit your needs. A stricter container will help you prevent missuses of your datum and knowing the usage of your data will help you chose the good container to get the best performances.

More information about container adapters can be found here

What should I use most of the time?

Many experts (Scott Meyer, Bjarne Stroustrup) suggest the use of the vector by default while others (like Herb Sutter as Steve Jessop pointed out) suggest the deque. I would strongly suggest you to chose the container that best suits your need.

相关问答

更多
  • 我的目标是通用容器: 一旦你习惯了它,你只要想到void *就意味着什么类型的东西,当我不关心它的类型。 这就像Java中的Object在很长一段时间里,通用容器也没有类型安全性。 你只有一个地方可以进行改进。 你没有得到类型安全; 但是通过重复执行类型安全的容器,可能会出现复制和粘贴错误的风险。 这也可能导致错误。 I'd aim for generic containers: Once you get used to it, you just think of void * is meaning the ...
  • 我有插件返回项目集合,我不希望插件知道我的代码使用的容器类型。 让你的插件将begin和end迭代器提供给它们的项目集合,然后按照你认为合适的方式使用该范围。 迭代器的最大优点是它们允许将数据的存储方式(容器)与数据的使用方式(算法;就您的情况而言,您的应用程序代码使用插件数据)完全解耦。 这样,您就不必关心插件如何存储他们的数据,并且插件不需要关心您的数据在您提交给他们之后如何处理。 I have plugins that return collections of items and I don't w ...
  • 这是一个基于已经推荐用于标准化的range-v3库的工作示例 #include #include using namespace ranges; int main() { std::vector a1{15, 7, 3, 5}; std::vector a2{ 1, 2, 6, 21}; sort(view::zip(a1, a2), std::less<>{}, &std::pair
  • 在形式上,除了接口和复杂性之外,在标准中指定的实现之外没有任何约束。 实际上,大多数(如果不是全部)实现都源自相同的代码库,并且非常相似。 向量的基本实现是三个指针。 向量中对象的实际内存是动态分配的。 根据矢量“增长”的方式,动态区域可能包含额外的内存; 三个指针指向内存的开始,当前使用的最后一个字节后的字节,以及分配的最后一个字节后的字节。 也许实现的最重要的方面是它分离分配和初始化:在许多情况下,向量将分配比所需更多的内存,而不在其中构造对象,并且仅在需要时构造对象。 此外,当您删除对象或清除向量时, ...
  • 您可以使用引用分配给对象 - 通过将循环变量作为引用: cout << "Increnting ... " << endl; for (MyObject &o : oset) o.value += 1000; *编辑* 但是因为set是一个有序容器,所以它返回const迭代器。 因此,如果您需要修改一个集合,您应该考虑使用另一个容器。 也许是地图? 但是,如果你真的需要改变一套 - 不要像下面的代码那样。 正如Matthieu指出的那样,这使得valgrind非常沮丧。 为什么你不能在迭代通过容器时绕过 ...
  • 你想要你的行如下所示: cout << (*it).top() << endl; 您正在取消引用该值而不是指向该值的指针。 请注意,我将->更改为a . “坚果”是“它”基本上是指向你的价值的指针,“* it”为你提供了价值,所以当你想访问你需要的值的成员时. 而不是-> 更新:另外,正如其他人指出的那样,有一个失踪; 在推动之后,你只添加了一个项目到列表中,然后增加了你的迭代器,它将你放在列表的最后,在一个值之后。 这会导致你遇到时间问题。 You want your line to read as f ...
  • 我不知道单个文档提供了您需要的所有内容,但大部分文档已在某处编目。 该引用站点有一个包含所有容器的所有成员函数的大表 这个SO问题有一个复杂保证的大表。 这个SO问题为您提供了一个在容器之间进行选择的决策树 。 容器成员函数的复杂性要求不难记忆,因为只有4个类别:(摊销) O(1) , O(log N) , O(N)和O(N log N) (成员函数std::list::sort()它真正跨越标准库的算法域)所以如果你想要你可以制作一个4色编码版本的cpp引用容器表。 选择正确的容器可以像使用std::ve ...
  • 序列容器 您可以将序列容器看作是“从头开始构建”的容器。 它们使用不同的结构来保存数据,并具有不同的算法时间来插入,删除和检索元素。 您可以在此处找到有关容器算法时间的大量信息 容器适配器 容器适配器的行为被添加到序列容器上,使得它们尊重不同的范例。 增加的行为可能是一个更严格的行为(堆栈将只允许你弹出/推动项目,没有随机插入)。 他们是其他类型的容器,不需要新的存储行为,那些已经存在的容器。 作为示例, 可以在向量上构建堆栈。 然后,它会使用vector的数据结构,但将使用限制在一组函数中以模仿堆栈。 最 ...
  • 使用range-v3 ,您可以这样做 const std::vector v1{"A", "B", "C"}, v2{"D", "E", "F"}; for (const auto& s : ranges::view::concat(v1, v2)) { std::cout << s << std::endl; } 演示 With range-v3, you may do const std::vector v1{"A", "B", "C ...
  • 目的地的所有元素都被销毁。 然后复制构造函数被调用多次作为目标的大小。 为什么? 不确定你在说什么。 assign通常实现为: template void assign(Iterator first, Iterator last) { erase(begin(), end()); // Calls the destructor for each item insert(begin(), first, last); // Will not call ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)