Opened 10 years ago

Closed 9 years ago

Last modified 7 years ago

#10279 closed task (fixed)

TabContainer: automated tests

Reported by: bill Owned by:
Priority: high Milestone: 1.6
Component: Dijit Version: 1.4.0b
Keywords: Cc:
Blocked By: Blocking:

Description

Write robot tests [plus some plain DOH tests] for TabContainer, including:

General/api tests:

  • initial instantiation
    • should have tab label for each pane
  • adding panes (addChild())
    • confirm tab label is added
    • left/right scroll buttons and menu button appear on overflow
    • new pane added to menu
  • deleting panes (removeChild())
    • confirm tab label is deleted
    • confirm scroll buttons disappear when no longer needed
    • check that removing a tab doesn't delete the widget, just detaches it
    • deleted tab removed from menu
  • selecting panes
    • check that the tab label is scrolled into view
  • changing the name of a tab
    • confirm left/right/menu scroll buttons appear/disappear as needed
    • menu is updated
  • icon
    • setting the icon initially
    • changing iconClass of pane reflects it in the tab label and menu
    • showTitle=false
  • closable tabs
    • check that tab label has close icon when specified
  • layout related
    • tab alignment (top/bottom/left/right)
    • for nested=true, adding many tabs resizes the tab content smaller to make room for the labels
    • doLayout=false mode should change size based on content

Robot tests:

  • mouse:
    • selecting a tab by clicking tab label
    • closing a tab
    • scrolling left/right
    • selecting a tab from the menu (confirm that tab label correctly scrolls into view)
  • keyboard:
    • tabIndex: pressing tab key goes to selected tab label, then second tab key goes to tab content
    • left/right arrow keys navigate to adjacent tab label, focusing it and scrolling tab label into view
    • closing a tab via TabButton context menu

I'm sure there are more things I forgot.

There are a few tests already in ContentPaneLayout.html and ContentPane.html and nestedStack.html, but they don't test any keyboard/mouse interaction or anything related to the scrolling tab controller.

Change History (25)

comment:1 Changed 10 years ago by bill

(In [20846]) In progress TabContainer? robot tests, thanks to John Riding (IBM, CCLA). Refs #10279.

comment:2 Changed 10 years ago by bill

(In [20847]) In progress TabContainer? (non-robot) DOH tests, thanks to John Ryding (IBM, CCLA), thanks John! Refs #10279.

comment:3 Changed 10 years ago by bill

(In [20853]) Updated TabContainer? (non-robot) DOH tests, thanks to John Ryding (IBM, CCLA), thanks John! Refs #10279.

comment:4 Changed 10 years ago by bill

(In [20860]) Fix for IE8, plus removing unneeded CSS and style changes. Refs #10279.

comment:5 Changed 10 years ago by bill

(In [20861]) Fixes to get tests running. Refs #10279.

comment:6 Changed 10 years ago by bill

(In [20862]) IE8 timing tweak, apparently the slide animation takes >500ms although in theory it takes 350ms. Refs #10279.

comment:7 Changed 10 years ago by bill

(In [20863]) Fix logic of last test, plus some comment/spacing fixes. Refs #10279.

comment:8 Changed 10 years ago by bill

(In [20864]) Increase the timeouts after left/right keypress to wait for animation to finish. Refs #10279.

comment:9 Changed 10 years ago by bill

(In [20867]) More updates to TabContainer? (non-robot) DOH tests, from John Ryding (IBM, CCLA), thanks John! Refs #10279.

comment:10 Changed 10 years ago by bill

(In [20868]) Use dojo.position() not deprecated dojo.coords(). Refs #10279.

comment:11 Changed 10 years ago by bill

(In [20881]) General cleanup and adding TODO's. Refs #10279.

comment:12 Changed 9 years ago by bill

(In [22071]) deterministic id's for TabContainers and ScrollingTabController's Menu's MenuItems, refs #10279

comment:13 Changed 9 years ago by bill

(In [22072]) deterministic id's for TabContainers and ScrollingTabController's Menu's MenuItems, refs #10279

comment:14 Changed 9 years ago by bill

(In [22086]) on chrome 4 ctrl+w isn't trapped, and closes the whole browser, refs #10279

comment:15 Changed 9 years ago by bill

(In [22100]) continuation from [22071], deterministic id's for TabContainers and ScrollingTabController's Menu's MenuItems, refs #10279

comment:16 Changed 9 years ago by Adam Peller

Milestone: 1.51.6

comment:17 Changed 9 years ago by bill

(In [22441]) chrome 5 has same problem as chrome 4: ctrl+w isn't trapped, and closes the whole browser, refs #10279

comment:18 Changed 9 years ago by bill

This is almost finished. The remaining tasks, AFAICT, are:

  • layout related
    • tab alignment (top/bottom/left/right)
    • for nested=true, adding many tabs resizes the tab content smaller to make room for the labels
    • doLayout=false mode should change size based on content
  • mouse
    • scroll left/right

comment:19 Changed 9 years ago by bill

(In [22524]) fix spacing/tabbing, refs #10279

comment:20 Changed 9 years ago by bill

Resolution: fixed
Status: newclosed

(In [22525]) Fix TabContainer layout tests, remove redundant destroy test, add left/right scroll button test. Fixes #10279.

comment:21 Changed 9 years ago by bill

(In [22526]) Use short names for assertions (doh.t(), doh.f(), doh.is()) like in the rest of the dijit tests, refs #10279.

comment:22 Changed 9 years ago by bill

(In [22527]) Test that content area size is reduced when the tabs overflow to two rows, refs #10279.

comment:23 Changed 8 years ago by bill

(In [23880]) Remove some unnecessary focus() calls, sending focus to the place where it already theoretically is. On IE6 when this test fails for some reason (timing condition?), it tries to focus a hidden element which causes an exception which pops up a dialog and hangs the test run (although I guess that only happens if you have IE setup to popup dialog in that case). Refs #10279.

comment:24 Changed 8 years ago by bill

(In [23881]) Convert most of TabContainer a11y test to listen for focus events, rather than using timers. Also cleaned up tabbing.

Refs #10279 !strict.

comment:25 Changed 7 years ago by bill

In [29054]:

avoid spurious failure, refs #10279

Note: See TracTickets for help on using tickets.