brudgers is 100% correct.
You have to happily design the same website over and over again for the rest of your life.
The real issue is communication. Large companies will know what to do and how it works. But some companies who have never done a project just simply have no basis for understanding. This is where your expertise comes in. You have to be so clear and explain over and over the issues with them not testing up front. Explain and show how expensive it is to make a change 95% into the project. I'm sure there are zillions of examples all over the internet, and videos galore that can 1) explain it to them, and 2) show that it is NOT you, but that is just the way it is.
Someone wrote that charging by the hour is superior than by project. That is one of those things that is like, "Yeah, except..." If you know how to do something extremely well and know exactly how much time it will take, you can quote a flat rate and make much, much more money than doing hourly, that's just a fact. Furthermore, in complex construction projects, they give a flat rate bid, and you tell me - how much more dangerous is doing a $2 billion construction project on an airport rather than a $20K or $30K or $100K software project? The way it is done is that the construction company gives a bid, but makes money on the change orders, which always happen. There's no way around it.
You just have to have an excellent contract, of course. But, again, communication is the key. If YOU don't communicate correctly, and 100% totally forthcoming to the client that you are working for, than it really is your fault. YOU are the one with the expertise. Show videos. Give presentations. Specifically on how changing into the design process will significantly escalate the price. And if they don't take it seriously up front and do the testing up front, it is on them.
And if they steadfastly refuse or won't commit the time to even hear what you have to say, let alone do the up front design work, then it's a strong signal to walk away. Either that or you find a way of doing smaller projects to teach them, if that is possible.