|
|
@ -23,28 +23,39 @@ export const genTest = (apiType, dbType) => { |
|
|
|
mainPage.hideField("LastUpdate"); |
|
|
|
mainPage.hideField("LastUpdate"); |
|
|
|
const verifyCsv = (retrievedRecords) => { |
|
|
|
const verifyCsv = (retrievedRecords) => { |
|
|
|
// expected output, statically configured
|
|
|
|
// expected output, statically configured
|
|
|
|
|
|
|
|
// let storedRecords = [
|
|
|
|
|
|
|
|
// `Country,CityList`,
|
|
|
|
|
|
|
|
// `Afghanistan,Kabul`,
|
|
|
|
|
|
|
|
// `Algeria,"Batna, Bchar, Skikda"`,
|
|
|
|
|
|
|
|
// `American Samoa,Tafuna`,
|
|
|
|
|
|
|
|
// `Angola,"Benguela, Namibe"`,
|
|
|
|
|
|
|
|
// ];
|
|
|
|
let storedRecords = [ |
|
|
|
let storedRecords = [ |
|
|
|
`Country,CityList`, |
|
|
|
['Country','CityList'], |
|
|
|
`Afghanistan,Kabul`, |
|
|
|
['Afghanistan','Kabul'], |
|
|
|
`Algeria,"Batna, Bchar, Skikda"`, |
|
|
|
['Algeria','Skikda', 'Bchar', 'Batna'], |
|
|
|
`American Samoa,Tafuna`, |
|
|
|
['American Samoa','Tafuna'], |
|
|
|
`Angola,"Benguela, Namibe"`, |
|
|
|
['Angola','Benguela', 'Namibe'], |
|
|
|
]; |
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
if (isPostgres()) { |
|
|
|
// if (isPostgres()) {
|
|
|
|
// order of second entry is different
|
|
|
|
// // order of second entry is different
|
|
|
|
storedRecords = [ |
|
|
|
// storedRecords = [
|
|
|
|
`Country,CityList`, |
|
|
|
// `Country,CityList`,
|
|
|
|
`Afghanistan,Kabul`, |
|
|
|
// `Afghanistan,Kabul`,
|
|
|
|
`Algeria,"Skikda, Bchar, Batna"`, |
|
|
|
// `Algeria,"Skikda, Bchar, Batna"`,
|
|
|
|
`American Samoa,Tafuna`, |
|
|
|
// `American Samoa,Tafuna`,
|
|
|
|
`Angola,"Benguela, Namibe"`, |
|
|
|
// `Angola,"Benguela, Namibe"`,
|
|
|
|
]; |
|
|
|
// ];
|
|
|
|
} |
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i < storedRecords.length - 1; i++) { |
|
|
|
for (let i = 0; i < storedRecords.length - 1; i++) { |
|
|
|
cy.log(retrievedRecords[i]); |
|
|
|
for(let j=0; j<storedRecords[i].length; j++) |
|
|
|
expect(retrievedRecords[i]).to.be.equal(storedRecords[i]); |
|
|
|
expect(retrievedRecords[i]).to.have.string(storedRecords[i][j]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// often, the order in which records "Skikda, Bchar, Batna" appear, used to toggle
|
|
|
|
|
|
|
|
// hence verifying record contents separately
|
|
|
|
|
|
|
|
// expect(retrievedRecords[i]).to.be.equal(storedRecords[i]);
|
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|