SAP 电商云 Spartacus UI CI e2e-cypress.sh 脚本文件分析
(1) yarn install
(2) 进到 storefrontapp-e2e-cypress 目录再次 yarn install
(3) yarn build:libs
脚本命令:
cypress run --config-file cypress.ci.json --record --key $CYPRESS_KEY --tag “2011,b2c,all,parallel” --p
arallel --group B2C --ci-build-id $TRAVIS_BUILD_ID --spec “cypress/integration/!(vendor|b2b|ssr)/**/*.e2e
-spec.ts”
record option 代表视频记录,这个语法在官方文档 可以找到。
export 命令本身不需要使用 $ 符号,但是在脚本文件里使用变量时,需要加上 $ 符号。
Bash export 命令帮助我们导出环境变量,以便它们在所有子进程
、shell 和命令中可用。
此外,export 命令和其他相关命令的不同命令行选项提供了跨不同 shell 和 bash 脚本定义、导出和使用 bash 变量的各种方法。
关于 bash 里特殊符号 $ 的用法,参考这个链接。
yarn e2e:run:ci"${SUITE}"
bash 里圆括号的语法
这里的 SUITE 是 script 里自定义的变量。
SUITE 值可能为下列 e2e:run:ci 冒号后的值,比如 ssr,b2b 等等。
取决于使用者按照什么样的命令行参数传递 --suite
使用 --suite 或者 -s 参数格式均可,默认参数为 b2c:
最后先 yarn start,再 yarn e2e:run:ci
我们就看这个默认的 b2b script:
yarn --cwd ./projects/storefrontapp-e2e-cypress run cy:run:ci:b2b\
使用 --cwd 避免脚本文件里出现不必要的 cd 操作符。参考这个操作符的官方文档。
cy:run:ci:b2b - 最后执行的如下脚本:
–tag 用于最后在 dashboard 结果列表里查看。
–group 用于在一个测试里将记录后的结果放置于同一组内。
开始执行测试了:
一些测试结果:
B2B - Bulk Pricing
Mobile
Check bulk pricing table
(node:8855) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
✓ should render pricing table for products that contain bulk prices (5819ms)
✓ should checkout using the proper bulk price based on quantity (1604ms)
✓ should NOT render pricing table for products that DO NOT contain bulk prices (736ms)
✓ should verify lowering the quantity also lowers the discount (2262ms)
✓ should verify increasing the quantity also increases the discount (1904ms)
✓ should verify checking out a bulk priced item and a regular product (7819ms)
Desktop
Check bulk pricing table
✓ should render pricing table for products that contain bulk prices (963ms)
✓ should checkout using the proper bulk price based on quantity (1307ms)
✓ should NOT render pricing table for products that DO NOT contain bulk prices (756ms)
✓ should verify lowering the quantity also lowers the discount (2282ms)
✓ should verify increasing the quantity also increases the discount (1941ms)
✓ should verify checking out a bulk priced item and a regular product (9332ms)
在执行日志的末尾,看到了 command exited with 0 的提示,说明执行成功。
更多Jerry的原创文章,尽在:“汪子熙”:
相关文章
- 使用 SAP UI5 sap.ui.export.Spreadsheet API 进行 Excel 导出的一些限制
- SAP UI5 sap.ui.Device.media 公有方法介绍
- SAP WebIDE的本地安装方式「建议收藏」
- SAP 电商云 Spartacus UI External Route 的模块实现概述
- [ChatGPT 勘误] SAP UI5 的 sap.ui.base.Object
- SAP ERP实施项目,到底是公司适应系统还是系统适应公司?
- 如何使用 SAP OData 服务向 ABAP 服务器上传文件试读版
- SAP UI5 应用 FlexBox 控件 growFactor 的使用方法
- SAP UI5 sap.m.Table 实现响应式布局的两种配置模式
- SAP UI5 响应式表格 sap.m.Table 根据不同宽度的屏幕动态决定显示或隐藏 Column 的实现源代码讲解试读版
- 将 SAP ABAP 内表内容本地导出成 Excel 文件试读版
- 2023-4-13 某SAP项目面试小记
- SAP Job 状态记录详解编程语言
- SAP在Linux上安装(sap安装linux)
- SAP vs Oracle:差异点与解析(sap和oracle的区别)
- Oracle与SAP权衡利弊比较之路(oracle与sap比较)
- Oracle和SAP技术比较优势和劣势(oracle与sap比照)
- Oracle SAP系统深入探索管理系统之魅力(oracle sap系统)
- Oracle 与 SAP深度对比分析(oracle sap对比)