You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been able to get the check_inbox to work properly. I have now tried to get the get-messages() to work, but I keep getting the following error message:
cy.task('gmail:get-messages') timed out after waiting 60000ms.
None of the messages are retrieved.
This is my index.js file:
const path = require("path");
const gmail = require("gmail-tester");
module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
on("task", {
"gmail:check": async args => {
const { from, to, subject } = args;
const email = await gmail.check_inbox(
path.resolve(__dirname, "credentials.json"), // credentials.json is inside plugins/ directory.
path.resolve(__dirname, "gmail_token.json"), // gmail_token.json is inside plugins/ directory.
subject,
from,
to,
10, // Poll interval (in seconds)
30 // Maximum poll interval (in seconds). If reached, return null, indicating the completion of the task().
);
return email;
}
});
on("task", {
"gmail:get-messages": async args => {
const messages = await gmail.get_messages(
path.resolve(__dirname, "credentials.json"),
path.resolve(__dirname, "token.json"),
args.options
);
return messages;
}
});
}
This is my sample_spec.js file;
describe("Email assertion:", () => {
it("Look for an email with specific subject and link in email body", function () {
// debugger; //Uncomment for debugger to work...
cy.task("gmail:get-messages", {
options: {
from: "someemail@mydomain.com",
subject: "Some Topic",
include_body: true
}
}).then(emails => {
// debugger;
console.log('emails', emails);
assert.isTrue(emails, "tesstss");
});
});
});
I have been able to get the check_inbox to work properly. I have now tried to get the get-messages() to work, but I keep getting the following error message:
cy.task('gmail:get-messages') timed out after waiting 60000ms.
None of the messages are retrieved.
This is my index.js file:
This is my sample_spec.js file;
This is my init.js file:
const gmail = require("./gmail-tester");
The text was updated successfully, but these errors were encountered: