magnificent-finland-58048
12/20/2022, 2:58 PMgray-kilobyte-89541
12/20/2022, 3:59 PMripe-traffic-15039
12/21/2022, 12:55 PMripe-traffic-15039
12/21/2022, 12:56 PMimport Warehouse from "../../../pagesObjects/customerDataPlatform/warehouse.cy";
const warehouse = new Warehouse();
describe("Regression Tests CDP GDPR", () => {
var completeDate = 0
var constants = ""
beforeEach(() => {
cy.viewport(Cypress.env("viewportWidth"), Cypress.env("viewportHeight"));
cy.login()
cy.getPlatformLanguageConstants().then(value => constants = value);
})
it('CDP-4071 GDPR - Consent Version. Edit Terms and Conditions', () => {
cy.getCodeTime().then(value => completeDate = value);
cy.visitUrl(Cypress.env('urls').cdp.complianceVersions.link)
cy.then(() => {
cy.textArea_TypeAndSave(warehouse.editableTermsConditions(),completeDate,warehouse.btnSaveTermsConditions())
});
cy.clickModalConfirmation()
cy.wait(1000)
cy.checkModal(constants.cdp.gdprModalTermsConditionsTitle,constants.cdp.gdprModalTermsConditions)
cy.visitUrl(Cypress.env('urls').cdp.complianceVersions.link)
cy.then(() => {
cy.checkText(warehouse.editableTermsConditions(),completeDate)
})
});
it('CDP-4072 GDPR - Consent Version. Edit Personalized communications', () => {
cy.getCodeTime().then(value => completeDate = value);
cy.visitUrl(Cypress.env('urls').cdp.complianceVersions.link)
cy.then(() => {
cy.textArea_TypeAndSave(warehouse.editablePersonalizedCommunications(),completeDate,warehouse.btnSaveConsent())
});
cy.clickModalConfirmation()
cy.wait(1000)
cy.checkModal(constants.cdp.gdprModalTermsConditionsTitle,constants.cdp.gdprModalTermsConditions)
cy.visitUrl(Cypress.env('urls').cdp.complianceVersions.link)
cy.checkText(warehouse.editablePersonalizedCommunications(),completeDate)
});
});
late-planet-4481
12/22/2022, 2:12 PMjs
it('returns values', () => {
const message = returnSomething()
cy.log(message)
})
function returnSomething() {
cy.log('howdy').then(() => {
return 'yo'
})
}
Expected: It should log 'yo'
Actual: It logs nothing
The reason I have this under 'best-practices' is because I can work around this using aliases like I would global variables, but doing that feels ugly and wrong.gray-kilobyte-89541
12/22/2022, 2:36 PMjs
function returnSomething() {
return cy.log('howdy').then(() => {
return 'yo'
})
}
it('returns values', () => {
returnSomething().then(cy.log)
})
Also about return values - inside returnSomething
you could do
js
function returnSomething() {
cy.log('howdy')
return cy.wrap('yo')
}
late-planet-4481
12/22/2022, 2:47 PMrough-book-31535
12/23/2022, 2:08 PMfaint-ocean-92094
12/29/2022, 8:50 PMgray-kilobyte-89541
12/29/2022, 9:06 PMjs
cy.contains('#table tbody tr', rowName).should("not.exist")
For more examples, see https://glebbahmutov.com/cypress-examples/commands/querying.html and https://glebbahmutov.com/cypress-examples/commands/assertions.html Also read https://glebbahmutov.com/blog/negative-assertions/magnificent-memory-85975
01/06/2023, 7:53 AMpurple-ice-75399
01/06/2023, 8:42 PMdemo
branch, and notify our testers to run Cypress from the new branch until everything is up to date, where we then point things back to master and re-notify the testers. Maintaining the different branches feels like pulling teeth at points, but so far is the only thing that seems to be working for us. Is there a better practice we should be following? Any recommendations?
Thanks in advance!stale-smartphone-76840
01/07/2023, 5:27 AMcypress open --e2e --browser chrome --config-file cypress/configs/cypress-preprod.config.js
Throughout my tests when I need to access a workflow that is user dependent I call Cypress.config("configpropertyname"). So in my case I end up calling things like Cypress.config("users").permissionTestUser.username and Cypress.config("users").permissionTestUser.id a lot for example. It is quite a bit to set up if you have a giant suite of tests already, but it works. Unless someone else has a simpler way to configure for different environments this is what I am going with!thousands-house-85089
01/08/2023, 3:05 AMbig-bird-63331
01/08/2023, 4:22 PMfaint-ocean-92094
01/09/2023, 5:14 PMrapid-crayon-60822
01/10/2023, 7:16 AMpowerful-orange-86819
01/10/2023, 8:21 AMmagnificent-finland-58048
01/10/2023, 3:46 PMmagnificent-finland-58048
01/10/2023, 3:49 PMmagnificent-finland-58048
01/10/2023, 3:53 PMmagnificent-finland-58048
01/10/2023, 3:55 PMgreen-controller-97889
01/12/2023, 2:55 PMearly-gigabyte-75871
01/12/2023, 7:24 PMearly-gigabyte-75871
01/12/2023, 7:25 PMmagnificent-finland-58048
01/13/2023, 12:58 PMmagnificent-finland-58048
01/13/2023, 1:05 PMearly-gigabyte-75871
01/13/2023, 8:03 PMlate-planet-4481
01/13/2023, 9:07 PMfreezing-piano-2792
01/13/2023, 9:33 PM