File tree Expand file tree Collapse file tree 2 files changed +45
-0
lines changed
docs/playwright/html/tabsets
integration/playwright/tests Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ title : " mwe"
3+ ---
4+
5+ ## Quarto
6+
7+ From https://github.com/quarto-dev/quarto-cli/issues/1456
8+
9+ ``` {python}
10+ from IPython.display import display, Markdown
11+ import matplotlib.pyplot as plt
12+ ```
13+
14+ ::: {.panel-tabset}
15+
16+ ``` {python}
17+ #| output: asis
18+ for i in ["tab1 inside for loop", "tab2 inside for loop"]:
19+ display(Markdown(f"\n# {i}:\n"))
20+ fig = plt.figure()
21+ ax = fig.add_subplot(111)
22+ plt.show()
23+ ```
24+
25+ :::
Original file line number Diff line number Diff line change 1+ import { test , expect } from '@playwright/test' ;
2+
3+ test ( 'Jupyter - Creates working tabsets from for loops' , async ( { page } ) => {
4+ await page . goto ( '/html/tabsets/jupyter-tabsets.html' ) ;
5+ const tab1 = page . getByRole ( 'tab' , { name : 'tab1 inside for loop:' } ) ;
6+ await expect ( tab1 ) . toHaveClass ( / a c t i v e / ) ;
7+ const tabContent = page . locator ( 'div.tab-content' )
8+ await expect ( tabContent ) . toBeVisible ( ) ;
9+ const tab1Content = tabContent . locator ( 'div.tab-pane' ) . first ( ) ;
10+ await expect ( tab1Content ) . toHaveClass ( / a c t i v e / ) ;
11+ await expect ( tab1Content . locator ( 'img' ) ) . toBeVisible ( ) ;
12+ const tab2 = page . getByRole ( 'tab' , { name : 'tab2 inside for loop:' } )
13+ await tab2 . click ( ) ;
14+ await expect ( tab1 ) . not . toHaveClass ( / a c t i v e / ) ;
15+ await expect ( tab1Content ) . not . toHaveClass ( / a c t i v e / ) ;
16+ await expect ( tab2 ) . toHaveClass ( / a c t i v e / ) ;
17+ const tab2Content = tabContent . locator ( 'div.tab-pane' ) . nth ( 1 ) ;
18+ await expect ( tab2Content ) . toHaveClass ( / a c t i v e / ) ;
19+ await expect ( tab2Content . locator ( 'img' ) ) . toBeVisible ( ) ;
20+ } ) ;
You can’t perform that action at this time.
0 commit comments