A plane designed to take on Boeing and Airbus has completed its maiden flight.