.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Test::Mojo 3pm" .TH Test::Mojo 3pm "2012-09-05" "perl v5.14.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Test::Mojo \- Testing Mojo! .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& use Test::More tests => 12; \& use Test::Mojo; \& \& my $t = Test::Mojo\->new(\*(AqMyApp\*(Aq); \& \& $t\->get_ok(\*(Aq/welcome\*(Aq)\->status_is(200)\->text_is(\*(Aqdiv#message\*(Aq => \*(AqHello!\*(Aq); \& \& $t\->post_form_ok(\*(Aq/search.json\*(Aq => {q => \*(AqPerl\*(Aq}) \& \->status_is(200) \& \->header_is(\*(AqX\-Powered\-By\*(Aq => \*(AqMojolicious (Perl)\*(Aq) \& \->header_isnt(\*(AqX\-Bender\*(Aq => \*(AqBite my shiny metal ass!\*(Aq); \& \->json_is(\*(Aq/results/4/title\*(Aq => \*(AqPerl rocks!\*(Aq); \& \& $t\->websocket_ok(\*(Aq/echo\*(Aq) \& \->send_ok(\*(Aqhello\*(Aq) \& \->message_is(\*(Aqecho: hello\*(Aq) \& \->finish_ok; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Test::Mojo is a collection of testing helpers for everyone developing Mojo and Mojolicious applications. .SH "ATTRIBUTES" .IX Header "ATTRIBUTES" Test::Mojo implements the following attributes. .ie n .SS """tx""" .el .SS "\f(CWtx\fP" .IX Subsection "tx" .Vb 2 \& my $tx = $t\->tx; \& $t = $t\->tx(Mojo::Transaction::HTTP\->new); .Ve .PP Current transaction, usually a Mojo::Transaction::HTTP object. .PP .Vb 3 \& # More specific tests \& is $t\->tx\->res\->json\->{foo}, \*(Aqbar\*(Aq, \*(Aqright value\*(Aq; \& ok $t\->tx\->res\->is_multipart, \*(Aqmultipart content\*(Aq; \& \& # Test custom transaction \& my $tx = $t\->ua\->build_form_tx(\*(Aq/user/99\*(Aq => {name => \*(Aqsri\*(Aq}); \& $tx\->req\->method(\*(AqPUT\*(Aq); \& $t\->tx($t\->ua\->start($tx)) \& \->status_is(200) \& \->text_is(\*(Aqdiv#message\*(Aq => \*(AqUser has been replaced.\*(Aq); .Ve .ie n .SS """ua""" .el .SS "\f(CWua\fP" .IX Subsection "ua" .Vb 2 \& my $ua = $t\->ua; \& $t = $t\->ua(Mojo::UserAgent\->new); .Ve .PP User agent used for testing, defaults to a Mojo::UserAgent object. .PP .Vb 2 \& # Allow redirects \& $t\->ua\->max_redirects(10); \& \& # Customize all transactions (including followed redirects) \& $t\->ua\->on(start => sub { \& my ($ua, $tx) = @_; \& $tx\->req\->headers\->accept_language(\*(Aqen\-US\*(Aq); \& }); \& \& # Request with Basic authentication \& $t\->get_ok($t\->ua\->app_url\->userinfo(\*(Aqsri:secr3t\*(Aq)\->path(\*(Aq/secrets\*(Aq)); .Ve .SH "METHODS" .IX Header "METHODS" Test::Mojo inherits all methods from Mojo::Base and implements the following new ones. .ie n .SS """new""" .el .SS "\f(CWnew\fP" .IX Subsection "new" .Vb 3 \& my $t = Test::Mojo\->new; \& my $t = Test::Mojo\->new(\*(AqMyApp\*(Aq); \& my $t = Test::Mojo\->new(MyApp\->new); .Ve .PP Construct a new Test::Mojo object. .ie n .SS """app""" .el .SS "\f(CWapp\fP" .IX Subsection "app" .Vb 2 \& my $app = $t\->app; \& $t = $t\->app(MyApp\->new); .Ve .PP Alias for \*(L"app\*(R" in Mojo::UserAgent. .PP .Vb 2 \& # Change log level \& $t\->app\->log\->level(\*(Aqfatal\*(Aq); \& \& # Test application directly \& is $t\->app\->defaults\->{foo}, \*(Aqbar\*(Aq, \*(Aqright value\*(Aq; \& ok $t\->app\->routes\->find(\*(Aqecho\*(Aq)\->is_websocket, \*(AqWebSocket route\*(Aq; \& \& # Change application behavior \& $t\->app\->hook(before_dispatch => sub { \& my $self = shift; \& $self\->render(text => \*(AqThis request did not reach the router.\*(Aq) \& if $self\->req\->url\->path\->contains(\*(Aq/user\*(Aq); \& }); .Ve .ie n .SS """content_is""" .el .SS "\f(CWcontent_is\fP" .IX Subsection "content_is" .Vb 2 \& $t = $t\->content_is(\*(Aqworking!\*(Aq); \& $t = $t\->content_is(\*(Aqworking!\*(Aq, \*(Aqright content\*(Aq); .Ve .PP Check response content for exact match. .ie n .SS """content_isnt""" .el .SS "\f(CWcontent_isnt\fP" .IX Subsection "content_isnt" .Vb 2 \& $t = $t\->content_isnt(\*(Aqworking!\*(Aq); \& $t = $t\->content_isnt(\*(Aqworking!\*(Aq, \*(Aqdifferent content\*(Aq); .Ve .PP Opposite of \f(CW\*(C`content_is\*(C'\fR. .ie n .SS """content_like""" .el .SS "\f(CWcontent_like\fP" .IX Subsection "content_like" .Vb 2 \& $t = $t\->content_like(qr/working!/); \& $t = $t\->content_like(qr/working!/, \*(Aqright content\*(Aq); .Ve .PP Check response content for similar match. .ie n .SS """content_unlike""" .el .SS "\f(CWcontent_unlike\fP" .IX Subsection "content_unlike" .Vb 2 \& $t = $t\->content_unlike(qr/working!/); \& $t = $t\->content_unlike(qr/working!/, \*(Aqdifferent content\*(Aq); .Ve .PP Opposite of \f(CW\*(C`content_like\*(C'\fR. .ie n .SS """content_type_is""" .el .SS "\f(CWcontent_type_is\fP" .IX Subsection "content_type_is" .Vb 1 \& $t = $t\->content_type_is(\*(Aqtext/html\*(Aq); .Ve .PP Check response \f(CW\*(C`Content\-Type\*(C'\fR header for exact match. .ie n .SS """content_type_isnt""" .el .SS "\f(CWcontent_type_isnt\fP" .IX Subsection "content_type_isnt" .Vb 1 \& $t = $t\->content_type_isnt(\*(Aqtext/html\*(Aq); .Ve .PP Opposite of \f(CW\*(C`content_type_is\*(C'\fR. .ie n .SS """content_type_like""" .el .SS "\f(CWcontent_type_like\fP" .IX Subsection "content_type_like" .Vb 2 \& $t = $t\->content_type_like(qr/text/); \& $t = $t\->content_type_like(qr/text/, \*(Aqright content type\*(Aq); .Ve .PP Check response \f(CW\*(C`Content\-Type\*(C'\fR header for similar match. .ie n .SS """content_type_unlike""" .el .SS "\f(CWcontent_type_unlike\fP" .IX Subsection "content_type_unlike" .Vb 2 \& $t = $t\->content_type_unlike(qr/text/); \& $t = $t\->content_type_unlike(qr/text/, \*(Aqdifferent content type\*(Aq); .Ve .PP Opposite of \f(CW\*(C`content_type_like\*(C'\fR. .ie n .SS """delete_ok""" .el .SS "\f(CWdelete_ok\fP" .IX Subsection "delete_ok" .Vb 2 \& $t = $t\->delete_ok(\*(Aq/foo\*(Aq); \& $t = $t\->delete_ok(\*(Aq/foo\*(Aq => {DNT => 1} => \*(AqHi!\*(Aq); .Ve .PP Perform a \f(CW\*(C`DELETE\*(C'\fR request and check for transport errors, takes the exact same arguments as \*(L"delete\*(R" in Mojo::UserAgent. .ie n .SS """element_exists""" .el .SS "\f(CWelement_exists\fP" .IX Subsection "element_exists" .Vb 2 \& $t = $t\->element_exists(\*(Aqdiv.foo[x=y]\*(Aq); \& $t = $t\->element_exists(\*(Aqhtml head title\*(Aq, \*(Aqhas a title\*(Aq); .Ve .PP Checks for existence of the \s-1CSS3\s0 selectors first matching \s-1XML/HTML\s0 element with Mojo::DOM. .ie n .SS """element_exists_not""" .el .SS "\f(CWelement_exists_not\fP" .IX Subsection "element_exists_not" .Vb 2 \& $t = $t\->element_exists_not(\*(Aqdiv.foo[x=y]\*(Aq); \& $t = $t\->element_exists_not(\*(Aqhtml head title\*(Aq, \*(Aqhas no title\*(Aq); .Ve .PP Opposite of \f(CW\*(C`element_exists\*(C'\fR. .ie n .SS """finish_ok""" .el .SS "\f(CWfinish_ok\fP" .IX Subsection "finish_ok" .Vb 2 \& $t = $t\->finish_ok; \& $t = $t\->finish_ok(\*(Aqfinished successfully\*(Aq); .Ve .PP Finish \f(CW\*(C`WebSocket\*(C'\fR connection. .ie n .SS """get_ok""" .el .SS "\f(CWget_ok\fP" .IX Subsection "get_ok" .Vb 2 \& $t = $t\->get_ok(\*(Aq/foo\*(Aq); \& $t = $t\->get_ok(\*(Aq/foo\*(Aq => {DNT => 1} => \*(AqHi!\*(Aq); .Ve .PP Perform a \f(CW\*(C`GET\*(C'\fR request and check for transport errors, takes the exact same arguments as \*(L"get\*(R" in Mojo::UserAgent. .ie n .SS """head_ok""" .el .SS "\f(CWhead_ok\fP" .IX Subsection "head_ok" .Vb 2 \& $t = $t\->head_ok(\*(Aq/foo\*(Aq); \& $t = $t\->head_ok(\*(Aq/foo\*(Aq => {DNT => 1} => \*(AqHi!\*(Aq); .Ve .PP Perform a \f(CW\*(C`HEAD\*(C'\fR request and check for transport errors, takes the exact same arguments as \*(L"head\*(R" in Mojo::UserAgent. .ie n .SS """header_is""" .el .SS "\f(CWheader_is\fP" .IX Subsection "header_is" .Vb 1 \& $t = $t\->header_is(Expect => \*(Aqfun\*(Aq); .Ve .PP Check response header for exact match. .ie n .SS """header_isnt""" .el .SS "\f(CWheader_isnt\fP" .IX Subsection "header_isnt" .Vb 1 \& $t = $t\->header_isnt(Expect => \*(Aqfun\*(Aq); .Ve .PP Opposite of \f(CW\*(C`header_is\*(C'\fR. .ie n .SS """header_like""" .el .SS "\f(CWheader_like\fP" .IX Subsection "header_like" .Vb 2 \& $t = $t\->header_like(Expect => qr/fun/); \& $t = $t\->header_like(Expect => qr/fun/, \*(Aqright header\*(Aq); .Ve .PP Check response header for similar match. .ie n .SS """header_unlike""" .el .SS "\f(CWheader_unlike\fP" .IX Subsection "header_unlike" .Vb 2 \& $t = $t\->header_like(Expect => qr/fun/); \& $t = $t\->header_like(Expect => qr/fun/, \*(Aqdifferent header\*(Aq); .Ve .PP Opposite of \f(CW\*(C`header_like\*(C'\fR. .ie n .SS """json_content_is""" .el .SS "\f(CWjson_content_is\fP" .IX Subsection "json_content_is" .Vb 3 \& $t = $t\->json_content_is([1, 2, 3]); \& $t = $t\->json_content_is([1, 2, 3], \*(Aqright content\*(Aq); \& $t = $t\->json_content_is({foo => \*(Aqbar\*(Aq, baz => 23}, \*(Aqright content\*(Aq); .Ve .PP Check response content for \s-1JSON\s0 data. .ie n .SS """json_is""" .el .SS "\f(CWjson_is\fP" .IX Subsection "json_is" .Vb 3 \& $t = $t\->json_is(\*(Aq/foo\*(Aq => {bar => [1, 2, 3]}); \& $t = $t\->json_is(\*(Aq/foo/bar\*(Aq => [1, 2, 3]); \& $t = $t\->json_is(\*(Aq/foo/bar/1\*(Aq => 2, \*(Aqright value\*(Aq); .Ve .PP Check the value extracted from \s-1JSON\s0 response using the given \s-1JSON\s0 Pointer with Mojo::JSON::Pointer. .ie n .SS """json_has""" .el .SS "\f(CWjson_has\fP" .IX Subsection "json_has" .Vb 2 \& $t = $t\->json_has(\*(Aq/foo\*(Aq); \& $t = $t\->json_has(\*(Aq/minibar\*(Aq, \*(Aqhas a minibar\*(Aq); .Ve .PP Check if \s-1JSON\s0 response contains a value that can be identified using the given \&\s-1JSON\s0 Pointer with Mojo::JSON::Pointer. .ie n .SS """json_hasnt""" .el .SS "\f(CWjson_hasnt\fP" .IX Subsection "json_hasnt" .Vb 2 \& $t = $t\->json_hasnt(\*(Aq/foo\*(Aq); \& $t = $t\->json_hasnt(\*(Aq/minibar\*(Aq, \*(Aqno minibar\*(Aq); .Ve .PP Opposite of \f(CW\*(C`json_has\*(C'\fR. .ie n .SS """message_is""" .el .SS "\f(CWmessage_is\fP" .IX Subsection "message_is" .Vb 2 \& $t = $t\->message_is(\*(Aqworking!\*(Aq); \& $t = $t\->message_is(\*(Aqworking!\*(Aq, \*(Aqright message\*(Aq); .Ve .PP Check WebSocket message for exact match. .ie n .SS """message_isnt""" .el .SS "\f(CWmessage_isnt\fP" .IX Subsection "message_isnt" .Vb 2 \& $t = $t\->message_isnt(\*(Aqworking!\*(Aq); \& $t = $t\->message_isnt(\*(Aqworking!\*(Aq, \*(Aqdifferent message\*(Aq); .Ve .PP Opposite of \f(CW\*(C`message_is\*(C'\fR. .ie n .SS """message_like""" .el .SS "\f(CWmessage_like\fP" .IX Subsection "message_like" .Vb 2 \& $t = $t\->message_like(qr/working!/); \& $t = $t\->message_like(qr/working!/, \*(Aqright message\*(Aq); .Ve .PP Check WebSocket message for similar match. .ie n .SS """message_unlike""" .el .SS "\f(CWmessage_unlike\fP" .IX Subsection "message_unlike" .Vb 2 \& $t = $t\->message_unlike(qr/working!/); \& $t = $t\->message_unlike(qr/working!/, \*(Aqdifferent message\*(Aq); .Ve .PP Opposite of \f(CW\*(C`message_like\*(C'\fR. .ie n .SS """options_ok""" .el .SS "\f(CWoptions_ok\fP" .IX Subsection "options_ok" .Vb 2 \& $t = $t\->options_ok(\*(Aq/foo\*(Aq); \& $t = $t\->options_ok(\*(Aq/foo\*(Aq => {DNT => 1} => \*(AqHi!\*(Aq); .Ve .PP Perform a \f(CW\*(C`OPTIONS\*(C'\fR request and check for transport errors, takes the exact same arguments as \*(L"options\*(R" in Mojo::UserAgent. .ie n .SS """patch_ok""" .el .SS "\f(CWpatch_ok\fP" .IX Subsection "patch_ok" .Vb 2 \& $t = $t\->patch_ok(\*(Aq/foo\*(Aq); \& $t = $t\->patch_ok(\*(Aq/foo\*(Aq => {DNT => 1} => \*(AqHi!\*(Aq); .Ve .PP Perform a \f(CW\*(C`PATCH\*(C'\fR request and check for transport errors, takes the exact same arguments as \*(L"patch\*(R" in Mojo::UserAgent. .ie n .SS """post_ok""" .el .SS "\f(CWpost_ok\fP" .IX Subsection "post_ok" .Vb 2 \& $t = $t\->post_ok(\*(Aq/foo\*(Aq); \& $t = $t\->post_ok(\*(Aq/foo\*(Aq => {DNT => 1} => \*(AqHi!\*(Aq); .Ve .PP Perform a \f(CW\*(C`POST\*(C'\fR request and check for transport errors, takes the exact same arguments as \*(L"post\*(R" in Mojo::UserAgent. .ie n .SS """post_form_ok""" .el .SS "\f(CWpost_form_ok\fP" .IX Subsection "post_form_ok" .Vb 2 \& $t = $t\->post_form_ok(\*(Aq/foo\*(Aq => {a => \*(Aqb\*(Aq}); \& $t = $t\->post_form_ok(\*(Aq/foo\*(Aq => \*(AqUTF\-8\*(Aq => {a => \*(Aqb\*(Aq} => {DNT => 1}); .Ve .PP Submit a \f(CW\*(C`POST\*(C'\fR form and check for transport errors, takes the exact same arguments as \*(L"post_form\*(R" in Mojo::UserAgent. .ie n .SS """put_ok""" .el .SS "\f(CWput_ok\fP" .IX Subsection "put_ok" .Vb 2 \& $t = $t\->put_ok(\*(Aq/foo\*(Aq); \& $t = $t\->put_ok(\*(Aq/foo\*(Aq => {DNT => 1} => \*(AqHi!\*(Aq); .Ve .PP Perform a \f(CW\*(C`PUT\*(C'\fR request and check for transport errors, takes the exact same arguments as \*(L"put\*(R" in Mojo::UserAgent. .ie n .SS """reset_session""" .el .SS "\f(CWreset_session\fP" .IX Subsection "reset_session" .Vb 1 \& $t = $t\->reset_session; .Ve .PP Reset user agent session. .ie n .SS """send_ok""" .el .SS "\f(CWsend_ok\fP" .IX Subsection "send_ok" .Vb 5 \& $t = $t\->send_ok({binary => $bytes}); \& $t = $t\->send_ok({text => $bytes}); \& $t = $t\->send_ok([$fin, $rsv1, $rsv2, $rsv3, $op, $payload]); \& $t = $t\->send_ok(\*(Aqhello\*(Aq); \& $t = $t\->send_ok(\*(Aqhello\*(Aq, \*(Aqsent successfully\*(Aq); .Ve .PP Send message or frame via WebSocket. .ie n .SS """status_is""" .el .SS "\f(CWstatus_is\fP" .IX Subsection "status_is" .Vb 1 \& $t = $t\->status_is(200); .Ve .PP Check response status for exact match. .ie n .SS """status_isnt""" .el .SS "\f(CWstatus_isnt\fP" .IX Subsection "status_isnt" .Vb 1 \& $t = $t\->status_isnt(200); .Ve .PP Opposite of \f(CW\*(C`status_is\*(C'\fR. .ie n .SS """text_is""" .el .SS "\f(CWtext_is\fP" .IX Subsection "text_is" .Vb 2 \& $t = $t\->text_is(\*(Aqdiv.foo[x=y]\*(Aq => \*(AqHello!\*(Aq); \& $t = $t\->text_is(\*(Aqhtml head title\*(Aq => \*(AqHello!\*(Aq, \*(Aqright title\*(Aq); .Ve .PP Checks text content of the \s-1CSS3\s0 selectors first matching \s-1XML/HTML\s0 element for exact match with Mojo::DOM. .ie n .SS """text_isnt""" .el .SS "\f(CWtext_isnt\fP" .IX Subsection "text_isnt" .Vb 2 \& $t = $t\->text_isnt(\*(Aqdiv.foo[x=y]\*(Aq => \*(AqHello!\*(Aq); \& $t = $t\->text_isnt(\*(Aqhtml head title\*(Aq => \*(AqHello!\*(Aq, \*(Aqdifferent title\*(Aq); .Ve .PP Opposite of \f(CW\*(C`text_is\*(C'\fR. .ie n .SS """text_like""" .el .SS "\f(CWtext_like\fP" .IX Subsection "text_like" .Vb 2 \& $t = $t\->text_like(\*(Aqdiv.foo[x=y]\*(Aq => qr/Hello/); \& $t = $t\->text_like(\*(Aqhtml head title\*(Aq => qr/Hello/, \*(Aqright title\*(Aq); .Ve .PP Checks text content of the \s-1CSS3\s0 selectors first matching \s-1XML/HTML\s0 element for similar match with Mojo::DOM. .ie n .SS """text_unlike""" .el .SS "\f(CWtext_unlike\fP" .IX Subsection "text_unlike" .Vb 2 \& $t = $t\->text_unlike(\*(Aqdiv.foo[x=y]\*(Aq => qr/Hello/); \& $t = $t\->text_unlike(\*(Aqhtml head title\*(Aq => qr/Hello/, \*(Aqdifferent title\*(Aq); .Ve .PP Opposite of \f(CW\*(C`text_like\*(C'\fR. .ie n .SS """websocket_ok""" .el .SS "\f(CWwebsocket_ok\fP" .IX Subsection "websocket_ok" .Vb 2 \& $t = $t\->websocket_ok(\*(Aq/echo\*(Aq); \& $t = $t\->websocket_ok(\*(Aq/echo\*(Aq => {DNT => 1}); .Ve .PP Open a \f(CW\*(C`WebSocket\*(C'\fR connection with transparent handshake, takes the exact same arguments as \*(L"websocket\*(R" in Mojo::UserAgent. .SH "SEE ALSO" .IX Header "SEE ALSO" Mojolicious, Mojolicious::Guides, .