json 脚本para Chromy mockando keyboardEvent no BackstopJS

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了json 脚本para Chromy mockando keyboardEvent no BackstopJS相关的知识,希望对你有一定的参考价值。

module.exports = function (chromy, scenario, vp) {
	var dropdownSelector = scenario.dropdownSelector;
	var dropdownSelectorClick = scenario.dropdownSelectorClick;
	var stillDoubtsButton = scenario.stillDoubtsButton;
	var textarea = scenario.textarea;

	chromy
		.wait(500)
		.click(dropdownSelector)
		.wait(dropdownSelectorClick)
		.click(dropdownSelectorClick)
		.wait(stillDoubtsButton)
		.click(stillDoubtsButton)
		.wait(500)
		.type(textarea, "a")
		.evaluate(() => {
			let KeyboardEvent = window.KeyboardEvent;
			let textareas = document.querySelector("textarea#enviar-email-description");
			var e = new KeyboardEvent("keyup", {
				bubbles: true,
				cancelable: true,
				char: "Q",
				key: "q",
				shiftKey: true,
				keyCode: 81
			});
			textareas.dispatchEvent(e);
		})
		.wait(500)
};
{
			"label": "Enviar e-mail - Warning Validação",
			"url": "http://localhost:3001/email-central-atendimento",
			"delay": 500,
			"selectors": [
				"document"
			],
			"dropdownSelector": ".dropdown-filter__text",
			"dropdownSelectorClick": ".dropdown-filter__item",
			"stillDoubtsButton": "a#button-doubts",
			"textarea": "textarea#enviar-email-description",
			"selectorExpansion": true,
			"misMatchThreshold": 0.1,
			"onReadyScript": "chromy/enviarEmailWarning.js",
			"requireSameDimensions": true
		}

以上是关于json 脚本para Chromy mockando keyboardEvent no BackstopJS的主要内容,如果未能解决你的问题,请参考以下文章

json 建立Json para apliaciones cordova

json dependencias para graphql

sh 脚本para fazer备份做MySQL para o S3 emumamáquinalinux

sh 脚本para fazer备份做MySQL para o S3 emumamáquinalinux

json dependencias para projeto前端反应com graphql

html 脚本Basico para FACEBOOK TABS