Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F22400060
form.test.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
form.test.ts
View Options
import
{
Locator
,
Page
}
from
"playwright"
;
import
{
expect
}
from
"@playwright/test"
;
import
{
RealAppTest
}
from
"../test_utils/test-on-real-app.js"
;
import
{
getBrowser
}
from
"../utils/browser-creator.js"
;
describe
(
"route form test"
,
()
=>
{
let
page
:
Page
;
before
(
async
()
=>
{
const
browser
=
await
getBrowser
();
const
context
=
await
browser
.
newContext
();
page
=
await
context
.
newPage
();
});
after
(
async
()
=>
{
await
page
.
close
();
});
it
(
"creates minimal sealious app, adds route with form and fills it"
,
async
function
()
{
const
test_app
=
await
RealAppTest
.
init
();
const
path
=
"/form-test/"
;
await
test_app
.
runSealgenCommand
(
`add-route --url=
${
path
}
--action=Sample --mode=form`
);
await
test_app
.
start
();
const
res
=
await
test_app
.
httpGET
(
path
);
if
(
res
.
status
!=
200
)
{
throw
new
Error
(
"url generated by add-route exists but doesn't return 200"
);
}
await
page
.
goto
(
test_app
.
fullURL
(
path
));
const
input
:
Locator
=
page
.
locator
(
"#password"
);
await
input
.
focus
();
await
input
.
fill
(
"abc123"
);
await
page
.
locator
(
"[type=submit]"
).
click
();
await
expect
(
page
.
locator
(
"text=Formularz wypełniony poprawnie"
)).
toBeVisible
();
await
test_app
.
close
();
}).
timeout
(
100
*
1000
);
});
File Metadata
Details
Attached
Mime Type
application/javascript
Expires
Fri, Nov 27, 17:57 (1 d, 12 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1199289
Default Alt Text
form.test.ts (1 KB)
Attached To
Mode
rSGEN sealgen
Attached
Detach File
Event Timeline