Nightwatch JS. Выполнение параллельных различных тестов

, например, если вы хотите закрыть форму окна при выполнении действия, есть два способа сделать это

1. Закрыть его непосредственно

Form1 f=new Form1();
f.close(); //u can use below comment also
//this.close();

2 . Мы также можем скрыть форму, не закрывая ее

 private void button1_Click(object sender, EventArgs e)
    {
        Form1 f1 = new Form1();
        Form2 f2 = new Form2();
        int flag = 0;
        string u, p;
        u = textBox1.Text;
        p = textBox2.Text;
        if(u=="username" && p=="pasword")
        {
            flag = 1;
        }
        else
        {
          MessageBox.Show("enter correct details");
        }
        if(flag==1)
        {
            f2.Show();
            this.Hide();
        }

    }
2
задан Devegnik 13 July 2018 в 07:20
поделиться

1 ответ

Я настраиваю свой конфиг, добавленный в среду: "test_settings": {"default": {"selenium_port": 4444, "selenium_host": "localhost", "default_path_prefix": "/ wd / hub", "silent" : true, "screenshots": {"enabled": true, "on_failure": true, "on_error": true, "path": "tmp_screenshots"}},

    "firefox": {
        "desiredCapabilities": {
            "browserName": "firefox",
            "marionette": true,
            "acceptSslCerts": true,
            "javascriptEnabled": true
        },
        "globals": {
            "type": "firefox",
            "user": "me1",
            "pass": "test"
        }
    },

    "chrome": {
        "desiredCapabilities": {
            "browserName": "chrome",
            "chromeOptions": {
                "args": [
                    "disable-web-security",
                    "use-fake-device-for-media-stream",
                    "use-fake-ui-for-media-stream"
                ]
            },
            "acceptSslCerts": true,
            "javascriptEnabled": true
        },
        "globals": {
            "type": "chrome",
            "user": "me1",
            "pass": "test"
        }
    },

и когда я запускаю выполнить строку ниже npm run nightwatch -t tests / google.js -e firefox, chrome Мой тест начинается в двух разных браузерах.

1
ответ дан Дмитрий Бокач 17 August 2018 в 13:27
поделиться
Другие вопросы по тегам:

Похожие вопросы: