cymap
Version:
Plugin for E2E email testing with cypress
46 lines (44 loc) • 1.03 kB
JavaScript
const ImapProxy = require("../src/imapProxy")
const { getAllMail, deleteAllMail, getEmailByIndex, deleteEmailByIndex, getEmailBySubject } = require("./commands")
module.exports = {
//1
setConnectionConfig(config) {
ImapProxy.setConnectionConfig(config)
return null
},
//2
createConnection() {
ImapProxy.createConnection()
return null
},
//3
destroyConnection() {
ImapProxy.destroyConnection()
return null
},
//4
async getAllMail() {
const mail = await getAllMail()
return mail
},
//5
async deleteAllMail() {
const areDeleted = await deleteAllMail()
return areDeleted
},
//6
async getEmailByIndex(index) {
const email = await getEmailByIndex(index)
return email
},
//7
async deleteEmailByIndex(index) {
const isDeleted = await deleteEmailByIndex(index)
return isDeleted
},
//8
async getEmailBySubject(index) {
const email = await getEmailBySubject(index)
return email
}
}