Advertisement
Guest User

Untitled

a guest
Oct 19th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. beforeEach(function() {
  2.  
  3. jasmine.addMatchers({
  4. toHaveClass: function() {
  5. return {
  6. compare: function(actual, expected) {
  7. return {
  8. pass: actual.getAttribute('class').then(function(classes) {
  9. return classes.split(' ').indexOf(expected) !== -1;
  10. })
  11. }
  12. }
  13. }
  14. }
  15. });
  16.  
  17. this.driver = new webdriver.Builder().forBrowser('firefox').build();
  18. this.driver.manage().window().maximize();
  19. this.driver.get('http://localhost:8000/');
  20. });
  21.  
  22. it('should not create conflicts between the headers', function() {
  23. this.driver.manage().window().setSize(767, 632);
  24. this.driver.findElement(webdriver.By.className('navbar-toggle')).click();
  25. var headerBar = this.driver.findElement(webdriver.By.className('navbar-collapse'));
  26. this.driver.manage().window().setSize(1000, 632).then(function() {
  27. expect(headerBar).not.toHaveClass('in');
  28. });
  29. });
  30.  
  31. jasmine.addMatchers({
  32. toNotHaveClass: function() {
  33. return {
  34. compare: function(actual, expected) {
  35. return {
  36. pass: actual.getAttribute('class').then(function(classes) {
  37. return classes.split(' ').indexOf(expected) === -1;
  38. })
  39. }
  40. }
  41. }
  42. }
  43. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement