【发布时间】:2020-06-04 06:40:17
【问题描述】:
您好,我必须将框架外的组件拖放到 iframe 主体中(可拖动源) 但它没有将我的组件拖到 iframe 可拖动源中
这是用于进入 iframe 的代码,它正在工作意味着它正在进入 iframe 并查找元素
const getIframeDocument = () => {
return cy.get(".gjs-frame").its("0.contentDocument").should("exist");
};
const getIframeBody = () => {
// get the document
return (
getIframeDocument()
// automatically retries until body is loaded
.its("body")
.should("not.be.undefined")
// wraps "body" DOM element to allow
// chaining more Cypress commands, like ".find(...)"
.then(cy.wrap)
);
};
和 像这样拖放到 iframe 中
getIframeBody().find("#wrapper").as("Target");
cy.get('[title="Url"]').drag("@Target");
这并没有给我任何错误这个拖动功能工作但同时拖放没有发生 drag and drop execution pic must see this
【问题讨论】:
标签: cypress