Advertisement
Guest User

Untitled

a guest
Dec 2nd, 2021
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1.  
  2.  
  3. it('name sorting test', () => {
  4.  
  5. cy.visit(`${Cypress.env('res_URL')}/test`);
  6.  
  7.  
  8.  
  9. const array = cy.get('#CustomerDDL').children()
  10.  
  11.  
  12.  
  13. .then(function (array) {
  14.  
  15. console.log(array)
  16.  
  17. const shiftArray = array.map((function () { return this.label; }))
  18.  
  19.  
  20.  
  21. console.log(shiftArray)
  22.  
  23. const partOfArray = shiftArray.slice(1, 100)
  24.  
  25. })
  26.  
  27.  
  28.  
  29. .each(($option, index) => {
  30.  
  31. partOfArray.push(Cypress.$($option).text());
  32.  
  33. })
  34.  
  35. .then(() => {
  36.  
  37. const sortArray = partOfArray.sort();
  38.  
  39. expect(partOfArray).to.equal(sortArray);
  40.  
  41. })
  42.  
  43. })
  44.  
  45. })
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement