@@ -3,6 +3,8 @@ import { Given, When, Then, setDefaultTimeout } from "@cucumber/cucumber";
33import { expect } from "@playwright/test" ;
44import { expectVisibility , expectVisuallyActive , refreshPageAfterDelay } from "../services/uiHelper" ;
55import { PlaywrightWorld } from "../support/PlaywrightWorld" ;
6+ import { getBlankJson } from "../services/templateJsons"
7+ import { jsonFilter } from "../services/filters"
68
79setDefaultTimeout ( 60 * 1000 * 4 ) ;
810
@@ -54,6 +56,15 @@ Given('ProduceMessage Value input is: {string}', async function(this: Playwright
5456 expect ( actualValue ) . toContain ( value ) ;
5557} ) ;
5658
59+ Given ( 'ProduceMessage Value input template Json' , async function ( this : PlaywrightWorld ) {
60+ const value = getBlankJson
61+ const textbox = this . locators . produceMessage . valueTextbox ;
62+ await textbox . fill ( value ) ;
63+
64+ const actualValue = await textbox . inputValue ( ) ;
65+ expect ( actualValue ) . toContain ( value ) ;
66+ } ) ;
67+
5768Given ( 'ProduceMessage Headers input key is: {string}, value is: {string}' , async function ( this : PlaywrightWorld , key : string , value : string ) {
5869 const header = `{"${ key } ":"${ value } "}` ;
5970 const textbox = this . locators . produceMessage . headersTextbox ;
@@ -133,4 +144,49 @@ When('TopicName menu clear messages clicked', async function(this: PlaywrightWor
133144When ( 'TopicName menu RecreateTopic clicked' , async function ( this : PlaywrightWorld ) {
134145 await this . locators . topicTopicName . menuItemRecreateTopic . click ( ) ;
135146 await this . locators . topicTopicName . confirm . click ( ) ;
147+ } ) ;
148+
149+ Given ( 'Topics TopicName AddFilters button click' , async function ( this : PlaywrightWorld ) {
150+ await this . locators . topicTopicName . addFilters . click ( ) ;
151+ } ) ;
152+
153+ Given ( 'Topics TopicName AddFilter visible is: {string}' , async function ( this : PlaywrightWorld , visible : string ) {
154+ await expectVisibility ( this . locators . topicTopicName . addFilterHead , "true" ) ;
155+ } ) ;
156+
157+ Given ( 'Topics TopicName AddFilter filterCode Json value is: {string}' , async function ( this : PlaywrightWorld , value : string ) {
158+ const filter = jsonFilter ( value ) ;
159+ await this . locators . topicTopicName . addFilterFilterCode . click ( ) ;
160+ const input = this . locators . topicTopicName . addFilterFilterCodeInput ;
161+ await input . fill ( filter ) ;
162+ } ) ;
163+
164+ Given ( 'Topics TopicName AddFilter filterCode change value is: {string}' , async function ( this : PlaywrightWorld , newValue : string ) {
165+ await this . locators . topicTopicName . addFilterFilterCode . click ( ) ;
166+ await this . locators . topicTopicName . addFilterFilterCodeInput . press ( 'Backspace' ) ;
167+ await this . locators . topicTopicName . addFilterFilterCodeInput . type ( newValue ) ;
168+ } ) ;
169+
170+ Given ( 'Topics TopicName AddFilter display name starts with: {string}' , async function ( this : PlaywrightWorld , namePrefix : string ) {
171+ await this . locators . topicTopicName . addFilterDisplayName . fill ( namePrefix ) ;
172+ } ) ;
173+
174+ When ( 'Topics TopicName AddFilter button click' , async function ( this : PlaywrightWorld ) {
175+ await this . locators . topicTopicName . addFilterButton . click ( ) ;
176+ } ) ;
177+
178+ Then ( 'Topics TopicName Messages filter name starts with: {string} visible is: {string}' , async function ( this : PlaywrightWorld , namePrefix : string , visible : string ) {
179+ await expectVisibility ( this . locators . topicTopicName . filterName ( namePrefix ) , visible ) ;
180+ } ) ;
181+
182+ Then ( 'Topics TopicName Messages exist is: {string}' , async function ( this : PlaywrightWorld , expected : string ) {
183+ await expectVisibility ( this . locators . topicTopicName . cellExists , expected ) ;
184+ } ) ;
185+
186+ Given ( 'Topics TopicName Messages edit filter button click' , async function ( this : PlaywrightWorld ) {
187+ await this . locators . topicTopicName . editFilter . click ( ) ;
188+ } ) ;
189+
190+ Then ( 'Topics TopicName AddFilter EditFilter button click' , async function ( this : PlaywrightWorld ) {
191+ await this . locators . topicTopicName . editFilterButton . click ( ) ;
136192} ) ;
0 commit comments