Extjs 如何进行基本的跨页测试?登录示例

Extjs 如何进行基本的跨页测试?登录示例,extjs,siesta,Extjs,Siesta,所以我正在用这段代码测试我的登录页面 describe('Testing the login page', function (t) { t.it('Should be possible to login', function (t) { t.chain( { waitForCQ : '>> textfield[itemId=login]' }, {

所以我正在用这段代码测试我的登录页面

describe('Testing the login page', function (t) {
    t.it('Should be possible to login', function (t) {
        t.chain(
            {
                waitForCQ : '>> textfield[itemId=login]'
            },
            {
                action  : 'type',
                target  : '>> textfield[itemId=login]',
                text    : 'accountname'
             },
            {
                action  : 'type',
                target  : '>> textfield[itemId=password]',
                text    : 'passwd[ENTER]'
             }
        )
    })
});
使用此线束。start()配置:

我面临一个问题。即使enablePageRedirect选项设置为true,测试似乎也不会从第一页持续到下一页。 相反,在siesta测试界面的日志记录区域(中间一个),我看到当页面更改时,测试从零开始重新启动。 用一个永不停止的旋转器

如何利用午睡做这样一个简单的跨页面测试? 医生并没有真正帮助我:


提前感谢

每个测试都应该从一个新页面开始,并且是独立的,因此您的每个测试都需要从新登录应用程序开始。启用页面重定向只是意味着一旦登录,应用程序可以在到达下一个页面后继续进行测试。下面是我们如何在测试中编写它的示例:

  test.chain(
    // Enter username
    {
      action: 'type',
      target: '#user_id',
      text: 'ACCOUNTNAMEHERE'
    },
    // Enter password
    {
      action: 'type',
      target: '#password',
      text: 'PASSWORDHERE'
    },
    // Set up detection of the page changing.
    // The trigger specifies what action will cause the
    // page to change. The timeout is the maximum length
    // to wait for the navigation to occur.
    {
      waitFor: 'PageLoad',
      timeout: 20000,
      trigger: {
        click: 'input[type=submit]'
      }
    }
  );
  test.chain(
    // Enter username
    {
      action: 'type',
      target: '#user_id',
      text: 'ACCOUNTNAMEHERE'
    },
    // Enter password
    {
      action: 'type',
      target: '#password',
      text: 'PASSWORDHERE'
    },
    // Set up detection of the page changing.
    // The trigger specifies what action will cause the
    // page to change. The timeout is the maximum length
    // to wait for the navigation to occur.
    {
      waitFor: 'PageLoad',
      timeout: 20000,
      trigger: {
        click: 'input[type=submit]'
      }
    }
  );