Skip to content

Commit 9f1f5a8

Browse files
committed
fix: Remove redundant comment as per review feedback
1 parent be2cf17 commit 9f1f5a8

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

internal/js/modules/k6/browser/common/locator.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,6 @@ func (l *Locator) pressSequentially(text string, opts *FramePressOptions) error
725725
chars := []rune(text)
726726

727727
for i, char := range chars {
728-
//Press the character
729728
if err := l.frame.press(l.selector, string(char), opts); err != nil {
730729
return fmt.Errorf("pressing character %q : %w", char, err)
731730
}

internal/js/modules/k6/browser/tests/locator_test.go

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -293,11 +293,7 @@ func TestLocator(t *testing.T) {
293293
{
294294
"PressSequentially", func(_ *testBrowser, p *common.Page) {
295295
lo := p.Locator("#inputText", nil)
296-
297-
//For input clearance if something is present by default
298296
require.NoError(t, lo.Clear(common.NewFrameFillOptions(lo.Timeout())))
299-
300-
// Testing pressSequentially
301297
require.NoError(t, lo.PressSequentially("hello", nil))
302298

303299
inputValue, err := p.InputValue("#inputText", common.NewFrameInputValueOptions(p.MainFrame().Timeout()))
@@ -308,21 +304,16 @@ func TestLocator(t *testing.T) {
308304
{
309305
"PressSequentiallyWithDelay", func(tb *testBrowser, p *common.Page) {
310306
lo := p.Locator("#inputText", nil)
311-
312-
//Clear the input
313307
require.NoError(t, lo.Clear(common.NewFrameFillOptions(lo.Timeout())))
314-
315-
//Create options with delay
316308
opts := tb.toSobekValue(map[string]any{
317309
"delay": int64(100),
318310
})
319-
320311
start := time.Now()
321312
require.NoError(t, lo.PressSequentially("text", opts))
322313
duration := time.Since(start)
323314

324-
// "text" has 4 characters and 3 delays between them.
325-
// it should wait at least 300ms.
315+
// "text" has 4 character and 3 delay between them .
316+
// It should wait atleast 300ms.
326317
require.GreaterOrEqual(t, duration.Milliseconds(), int64(300))
327318

328319
inputValue, err := p.InputValue("#inputText", common.NewFrameInputValueOptions(p.MainFrame().Timeout()))
@@ -333,13 +324,8 @@ func TestLocator(t *testing.T) {
333324
{
334325
"PressSequentiallyInTextArea", func(_ *testBrowser, p *common.Page) {
335326
lo := p.Locator("textarea", nil)
336-
337-
//Clear textarea first
338327
require.NoError(t, lo.Clear(common.NewFrameFillOptions(lo.Timeout())))
339-
340-
//Test in textArea
341328
require.NoError(t, lo.PressSequentially("multi line", nil))
342-
343329
inputValue, err := p.InputValue("textArea", common.NewFrameInputValueOptions(p.MainFrame().Timeout()))
344330
require.NoError(t, err)
345331
require.Equal(t, "multi line", inputValue)

0 commit comments

Comments
 (0)