mirror of
https://github.com/maputnik/editor.git
synced 2026-08-24 05:57:25 +00:00
improve drivers
This commit is contained in:
@@ -5,37 +5,21 @@ export default class CypressWrapperDriver {
|
||||
|
||||
public given = {
|
||||
...this.helper.given,
|
||||
/**
|
||||
*
|
||||
* @param url a url to a file, this assumes the file name is the last part of the url
|
||||
* @param alias
|
||||
*/
|
||||
interceptGetToFile(url: string) {
|
||||
let fileNameAndAlias = url.split('/').pop();
|
||||
cy.intercept('GET', url, { fixture: fileNameAndAlias }).as(fileNameAndAlias!);
|
||||
},
|
||||
|
||||
interceptAndIgnore(url: string) {
|
||||
cy.intercept({ method: "GET", url }, []);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public get = {
|
||||
...this.helper.get,
|
||||
elementByClassOrType(slector: string) {
|
||||
return cy.get(slector);
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
public when = {
|
||||
...this.helper.when,
|
||||
visit(address: string) {
|
||||
cy.visit(address);
|
||||
},
|
||||
confirmAlert() {
|
||||
cy.on("window:confirm", () => true);
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
public beforeAndAfter = this.helper.beforeAndAfter;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user