HEX
Server: nginx/1.28.1
System: Linux 10-41-63-61 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64
User: www (1001)
PHP: 7.4.33
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/www.shooperm.com/tests/Browser/Modules/GeneralSetting/SMTPSetupTest.php
<?php

namespace Tests\Browser\Modules\GeneralSetting;

use Illuminate\Foundation\Testing\DatabaseMigrations;
use Laravel\Dusk\Browser;
use Tests\DuskTestCase;

class SMTPSetupTest extends DuskTestCase
{
    /**
     * A Dusk test example.
     *
     * @return void
     */
    public function test_for_visit_smtp_index_page()
    {
        $this->browse(function (Browser $browser) {
            $browser->loginAs(1)
                ->visit('/generalsetting/smtp-setting')
                ->assertSee('SMTP Settings');
        });
    }

    public function test_for_smtp_update(){
        $this->test_for_visit_smtp_index_page();
        $this->browse(function (Browser $browser) {
            $browser->click('#smtp > div:nth-child(1) > div > div')
                ->click('#smtp > div:nth-child(1) > div > div > ul > li:nth-child(1)')
                ->type('#smtp > div:nth-child(2) > div > input.primary_input_field', 'Amazcart Ltd')
                ->type('#smtp > div:nth-child(3) > div > input.primary_input_field', 'hafijurrahman970@gmail.com')
                ->type('#smtp > div:nth-child(4) > div > input.primary_input_field' ,'smtp.gmail.com')
                ->type('#smtp > div:nth-child(5) > div > input.primary_input_field', '587')
                ->type('#smtp > div:nth-child(6) > div > input.primary_input_field', 'hafijurrahman970@gmail.com')
                ->type('#smtp > div:nth-child(7) > div > input.primary_input_field', 'sldxtqmwhutuspbi')
                ->click('#smtp > div:nth-child(8) > div > div')
                ->click('#smtp > div:nth-child(8) > div > div > ul > li:nth-child(2)')
                ->type('#smtp > div:nth-child(9) > div > input.primary_input_field', 'utf-8')
                ->type('#main-content > section > div > div > div > div > form:nth-child(2) > div:nth-child(5) > div:nth-child(1) > div > textarea', 'test')
                ->type('#main-content > section > div > div > div > div > form:nth-child(2) > div:nth-child(5) > div:nth-child(2) > div > textarea', 'test')
                ->type('#main-content > section > div > div > div > div > form:nth-child(2) > div:nth-child(5) > div:nth-child(3) > div > textarea', 'test')
                ->click('#main-content > section > div > div > div > div > form:nth-child(2) > div:nth-child(5) > div.col-12.mb-45.pt_15 > div > button')
                ->assertPathIs('/generalsetting/smtp-setting')
                ->waitFor('.toast-message',25)
                ->assertSeeIn('.toast-message', 'Updated successfully!');
        });
    }

    public function test_for_mail_sent(){
        $this->test_for_visit_smtp_index_page();
        $this->browse(function (Browser $browser) {
            $browser->type('#main-content > section > div > div > div > div > form:nth-child(4) > div.row > div:nth-child(1) > div > input', 'spn21@spondonit.com')
                ->type('#main-content > section > div > div > div > div > form:nth-child(4) > div.row > div:nth-child(2) > div > input', 'test mail')
                ->click('#main-content > section > div > div > div > div > form:nth-child(4) > div.submit_btn.text-center.mb-100.pt_15 > button')
                ->assertPathIs('/generalsetting/smtp-setting')
                ->waitFor('.toast-message',25)
                ->assertSeeIn('.toast-message', 'Mail has been sent Successfully');
                
                
        });
    }

    public function test_for_sendmail_update(){
        $this->test_for_visit_smtp_index_page();
        $this->browse(function (Browser $browser) {
            $browser->click('#main-content > section > div > div > div > div > form:nth-child(2) > div:nth-child(2) > div > div > div')
                ->click('#main-content > section > div > div > div > div > form:nth-child(2) > div:nth-child(2) > div > div > div > ul > li:nth-child(2)')
                ->type('#sendmail > div:nth-child(1) > div > input.primary_input_field', 'Amazcart')
                ->type('#sendmail > div:nth-child(2) > div > input.primary_input_field', 'spn21@spondotit.com')
                ->type('#main-content > section > div > div > div > div > form:nth-child(2) > div:nth-child(5) > div:nth-child(1) > div > textarea', 'test')
                ->type('#main-content > section > div > div > div > div > form:nth-child(2) > div:nth-child(5) > div:nth-child(2) > div > textarea', 'test')
                ->type('#main-content > section > div > div > div > div > form:nth-child(2) > div:nth-child(5) > div:nth-child(3) > div > textarea', 'test')
                ->click('#main-content > section > div > div > div > div > form:nth-child(2) > div:nth-child(5) > div.col-12.mb-45.pt_15 > div > button')
                ->assertPathIs('/generalsetting/smtp-setting')
                ->waitFor('.toast-message',25)
                ->assertSeeIn('.toast-message', 'Updated successfully!');

        });    
    }


}