Simple test to see if esp8266 is working on mega2560 with built in esp8266

have a look at Mega-WiFi_R3_ATmega2560_ESP8266

also arduino-mega-at2560-with-integrated-esp8266-wifi-how-to-connect