Slide 10
Slide 10 text
$this->browse(function($browser) {
// login
$browser->visit('https://site1.test/login')
->type('email', config('service.site1_email'))
->type('password', config('service.site1_password'))
->press('Login');
// get text
$text = $browser->text('#app > main > div > div > div > div > div.card-body');
// slack post
$guzzle = new \GuzzleHttp\Client();
$guzzle->post(config('service.slack.webhook_url'), [
'body' => json_encode([
'channel' => config('service.slack.channel'),
'text' => $text,
'username' => config('service.slack.username'),
'icon_emoji' => config('service.slack.icon'),
]),
]);
});