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 电商云 Spartacus UI CI e2e-cypress.sh 脚本文件分析相关推荐
- SAP 电商云 Spartacus UI CI 脚本分析
分析入口,打开这个 build:有一个 build id 能查看到 Travis 上这个 build 有很多 job 组成: 我们查看其中名叫 E2E regression tests for B2B ...
- SAP 电商云 Spartacus UI 产品搜索结果的设计明细
我们使用如下 url 访问 SAP 电商云 Spartacus UI 产品搜索页面: http://localhost:4000/electronics-spa/en/USD/search/sony ...
- Mobile first 设计思路在 SAP 电商云 Spartacus UI 中的设计体现一例
关于 Mobile First 的概念,请查看我这篇文章:什么是前端开发中的 mobile first 策略. 下图是 SAP 电商云 Spartacus UI 的搜索结果页面: 其布局设计:temp ...
- SAP 电商云 Spartacus UI ComponentDataProvider defer 工厂函数
为什么 this.componentService.getItems 最后就触发到 Component-data.provider.ts 工厂函数的执行了? 29行的 getService: getS ...
- SAP 电商云 Spartacus UI 里如何捕捉语言设置的更改
我们知道在 SAP 电商云 Spartacus UI 里,用户可以通过下拉菜单更改当前访问 site 的语言: 监控语言变化的代码: this.subscription.add(this.langua ...
- 在 SAP 电商云 Spartacus UI 里手动注入 module 的几种排列组合
先把所有的排列组合罗列如下: (1) 通过构造函数注入 QuickOrderFacade,但不调用其方法 (2) 通过构造函数注入 QuickOrderFacade,调用其方法 (3) 手动通过 in ...
- SAP 电商云 Spartacus UI Proxy Facade 的一个实际例子
如何理解 SAP 电商云 Spartacus UI 中的 proxy facade? Jerry 这篇文章什么是 SAP 电商云 Spartacus UI 的 proxy façade提供了理论上的解 ...
- SAP 电商云 Spartacus UI Quick Order 主页的实现
存货单位(英語:stock keeping unit,SKU/ˌɛsˌkeɪˈjuː/),也翻译为库存单元,是一個會計學名詞,定义为库存管理中的最小可用单元,例如纺织品中一个SKU通常表示规格.颜色. ...
- SAP 电商云 Spartacus UI 从 CMS 取回 slots 和 component 之后的处理
从前一篇文章SAP 电商云 Spartacus UI 的双重 layout 配置层设计 我们得知,Spartacus 层面的 layout-config.ts 可以控制 page template 应 ...
最新文章
- 数据结构与算法(1)高斯算法
- python ip代理池_python实现ip代理池功能示例
- vue 表单 验证 async-validator
- windows 通过批处理 修改环境变量
- probe request帧结构_WLAN 无线网络 09 - 管理帧
- php date函数实现,PHP date() 函数可实现的功能列表
- MySQL入门(详细总结)
- 5分钟快速入门大数据、数据挖掘、机器学习
- 思科2960-S交换机初始化配置
- Java虚拟机(JVM)面试题(2022年总结最全面的面试题!!!)
- matlab 图片RGB颜色提取
- 使用Asponse.cells生成图片如何去掉水印
- TCP/IP知识总结面试题之Socket服务
- java-net-php-python-ssm巴音学院本科部校园网站计算机毕业设计程序
- java正则表达式 位置_正则表达式(一)—位置锚定
- 【Java定时任务】浅谈CronTrigger的用法和在线Cron表达式生成网址
- Abaqus流固耦合仿真方法
- php字符串转数组,数组合并成字符串
- js的scroll事件
- openstack 云计算 cinder块存储、镜像制作、云主机管理