I see now.
Well the problem isn't autowrap, it is that you only have 1 line. The line is being wrapped in the box, but it doesn't modify your string to include any newline/carriage returns.
The text you're sending in this example is simply element 0 of your text variable, which is "test".
As a single line with no newlines characters, there is nothing you can split the string with.
This is an example of something you might want to do if you want to set up such scenarios directly in script.
extends Label
var lines = ["line1", "line2", "line3"]
func _ready():
var string = ""
var first_line = true
for line in lines:
if(first_line):
first_line = false
string += line
else:
string += "\n" + line
set_text(string)
print(string.split("\n")[1]) # Get line 2