code: function (opts) {
              var that = this;
  
              if (opts.parent) {
                  return function () {
                      return this.wait(1000).thenOpen(globals.adminPagesUrl)
                          .waitUntilVisible('.cms-pagetree-jstree')
                          .then(that.waitUntilAllAjaxCallsFinish())
                          .then(that.expandPageTree())
                          .then(function () {
                              var pageId = that.getPageNodeId(opts.parent);
  
                              // add nested page
                              this.click('a[href*="/admin/cms/pagecontent/add/?parent_node=' + pageId + '"]');
                          })
                          .waitForSelector('#page_form', function () {
                              this.sendKeys('#id_title', opts.title);
                          })
                          .waitForUrl(/add/)
                          .wait(250, function () {
                              this.click('input[name="_save"]');
                          })
                          .waitForResource(/add/)
                          .waitUntilVisible('.success')
                          .waitForUrl(/cms/)
                          .then(that.waitUntilAllAjaxCallsFinish())
                          .wait(1000);
                  };
              }
  
              // add page as usual
              return function () {
                  return this.wait(1000).thenOpen(globals.adminPagesUrl + 'add/')
                      .waitForUrl(/add/)
                      .waitUntilVisible('#id_title')
                      .then(function () {
                          this.sendKeys('#id_title', opts.title);
                      })
                      .wait(250, function () {
                          this.click('input[name="_save"]');
                      })
                      .waitForResource(/add/)
                      .waitForUrl(/cms/)
                      .waitUntilVisible('.success')
                      .then(that.waitUntilAllAjaxCallsFinish())
                      .wait(1000);
              };
          }
docs: Adds the page. Optionally added page can be nested into
  a parent with given title (first in a list of equal titles taken).
  
  @public
  @param {Object} opts
  @param {String} opts.title name of the page
  @param {String} [opts.title] name of the parent page
  @returns {Function}