googleDemoTest.js 805 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. describe('Google demo test for Mocha', function() {
  2. describe('for demo purposes', function() {
  3. before(function(client, done) {
  4. done();
  5. });
  6. after(function(client, done) {
  7. if (client.sessionId) {
  8. client.end(function() {
  9. done();
  10. });
  11. } else {
  12. done();
  13. }
  14. });
  15. afterEach(function(client, done) {
  16. done();
  17. });
  18. beforeEach(function(client, done) {
  19. done();
  20. });
  21. it('uses BDD to run the Google simple test', function(client) {
  22. client
  23. .url('http://google.com')
  24. .expect.element('body').to.be.present.before(1000);
  25. client.setValue('input[type=text]', ['nightwatch', client.Keys.ENTER])
  26. .pause(1000)
  27. .assert.containsText('#main', 'Night Watch');
  28. });
  29. });
  30. });