Java - Test - TestNG: idea to add testng dependent

1 Overview

  1. maven Idea developed add-dependent testng

2. Background

  1. Recent review TestNG
    1. Try to set up environment
    2. I found a lot of textbooks and online tutorials, all of eclipse
  2. I use the idea
    1. This looks like a lot of places did not find, or that speaks unclear

3. Environment

  1. the
    1. win
      1. 10
  2. here
    1. idea
      1. 2018.01
  3. maven
    1. 3.6.0
  4. spring boot
    1. 2.2.1 release

4. Prepare

  1. Spring Boot project
    1. Outline
      1. Prepare in advance a Spring Boot project
      2. Once you've created, you can wait for the idea to build success

5. Operation

  1. To confirm the plug
    1. Open the idea of ​​plug-in settings
      1. Mode 1
        1. path

          file > settings > plugins
      2. Mode 2
        1. hot key

          ctrl + alt + s
    2. Find the plug
      1. Entry

        testng
    3. result
      1. normal circumstances
        1. Find a TestNG-J plug
      2. other
        1. If not, install
          1. Installation way I do not write this very good looking
  2. The introduction of dependence
    1. Method 1: Traditional methods - pom add dependencies
      1. step
        1. Determine the version
        2. Confirm description
        3. Modify pom
        4. Import dependence
      2. This will not elaborate on it, we should be able
        1. Not students, can look for add dependencies maven
    2. Method 2: When you create a Test class, by the way introduced
      1. step
        1. Find a code classes
        2. Right menu
        3. goto > test
        4. After selecting to create a new test class pop-up dialog
        5. Testing library drop-down menu, the default is JUnit5
        6. We replaced TestNG
        7. That does not introduce dependence, so the dialog box will prompt module can not be found
        8. Click the button next fix
        9. If not, in fact, this time, has been added dependent on the completion of the
          1. You do not need to create a test class out
          2. No problem on the spot Exit
      2. other
        1. Question 1: testng version
          1. problem
            1. Method 2 does not specify the version of testng
            2. Version of choice, is the most current release version, does not usually have a big problem
          2. solve
            1. Directly
            2. Need to switch, then only you can go to change to change pom
        2. goto
          1. A jump is relatively easy
            1. Endpoint
              1. Code
              2. Test code
            2. direction
              1. Two-way, both sides can jump back and forth
          2. Create a test class
            1. create
              1. Specify the class name
              2. Specifies the method name
              3. Specifies the setup and teardown
            2. feel
              1. Convenient for a lot of it
              2. At least more than their hands to knock a lot of convenience
            3. After the individual is no longer teach you how to create a test class

ps

  1. ref
    1. java idea of ​​integration testng, Maven
  2. Follow-up
    1. Create a test class
      1. This is not taught
    2. Use the test class
      1. This can teach
      2. The main comment is this will be more
    3. Configuration test suite / suite
      1. This will have to pay
    4. And integrated jenkins
      1. This can teach

Guess you like

Origin www.cnblogs.com/xy14/p/11822931.html
Recommended