Skip to content

Working with tables #2190

Answered by viper3400
eyesopen asked this question in How to... ?
Discussion options

You must be logged in to vote

Hi @eyesopen, I don't know how your original table and use case looks like, but,

  • given a simple table like this one
  • and given, you know the index of the row you want to access,

I would normally go for something like this to get a readable report in domain specific language:

import { Ensure, equals } from '@serenity-js/assertions';
import { Log } from '@serenity-js/core';
import { describe, it } from '@serenity-js/playwright-test';
import { By, Navigate, PageElements, Text } from '@serenity-js/web';

const CustomersTable = () => PageElement.located(By.css('#customers'))
    .describedAs('customer table')

const TableRows = () => PageElements.located(By.css('tr'))
    .describedAs('all ta…

Replies: 5 comments

Comment options

viper3400
Jan 27, 2024
Collaborator Sponsor

You must be logged in to vote
0 replies
Answer selected by jan-molak
Comment options

You must be logged in to vote
0 replies
Comment options

viper3400
Jan 30, 2024
Collaborator Sponsor

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@serenity-js/assertions Screenplay-style assertions library @serenity-js/web Screenplay Pattern APIs for interacting with the Web
2 participants